Saturday, February 25, 2012

Problems with bidirectional transactional replication

Hi, I have a four servers in bidirectional transactional replication
(publisher, publicator and subscriber), the problem is when I to be activate
the subscription with one server, the transactional process in the client
application (.Net) fails and send me an error.
Please post up full error message and how you are activating the
subscription...
Rgds,
Paul Ibison
|||OK.
The message is "Cannot find to member name "System.SqlClient.SqlError
server"" in the application client. I disabled the subscription and the error
is vanish.
"Paul Ibison" wrote:

> Please post up full error message and how you are activating the
> subscription...
> Rgds,
> Paul Ibison
>

Problems with BCP.

I just found out that there is a chance that bcp can restore my .dat files from SQL server 6.5 (see http://www.dbforums.com/showthread.php?p=3702315#post3702315 for more details).

the only problem i have with this is that i have never used bcp before, and as you would expect with a newbie, i don't have a clue on how to use it. All i know is that i want to export the data tables and import them into my SQL server 2000 install.

If anyone could give me a hand it would be greatly appreciated.If all you have is a .DAT file, and you haven't DISK REFIT/DISK REINIT it, - BCP is not going to help you.

Problems with backup

Hello;
I've problems with the differents data bases backups with SQL SERVER 2000.
If I launch the backup manualy of the differents data bases I have no
problem; but when I schedule the backup it fails show me in the event viewer
application this message:
Origen: SQLSERVERAGENT
Categoria: Job Engine
ID: 208
Descripción:
SQL Server Scheduled Job 'Copia de seguridad master'
(0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
2005-09-20 13:14:35 - Message: El trabajó falló. No se puede determinar s
i
el
propietario (Dominio\Usuario) del trabajo Copia de seguridad master tiene
acceso al servidor (motivo: No se puede conectar al servidor, compruebe los
registros de errores de SQL Server y del Agente SQL Server).
I'm spanish, and I have the spanish edtion, I will try to translate the
message.
Source: SQLSERVERAGENT
Category: Job Engine
ID: 208
Description:
SQL Server Scheduled Job 'Copia de seguridad master'
(0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
2005-09-20 13:14:35 - Message: The job fails. It can't determinate if the
property (Domain\User) of de job "Copia de seguridad master" have access to
de server (reasolt: It can't conect to the server, check the error log in SQ
L
Server and the SQL Server Agent)
This error ocours when I backup all the data bases, not only with the master
ThanksP.Burguete wrote:
> Hello;
> I've problems with the differents data bases backups with SQL SERVER 2000.
> If I launch the backup manualy of the differents data bases I have no
> problem; but when I schedule the backup it fails show me in the event view
er
> application this message:
> Origen: SQLSERVERAGENT
> Categoria: Job Engine
> ID: 208
> Descripción:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: El trabajó falló. No se puede determinar
si
> el
> propietario (Dominio\Usuario) del trabajo Copia de seguridad master tiene
> acceso al servidor (motivo: No se puede conectar al servidor, compruebe lo
s
> registros de errores de SQL Server y del Agente SQL Server).
> I'm spanish, and I have the spanish edtion, I will try to translate the
> message.
> Source: SQLSERVERAGENT
> Category: Job Engine
> ID: 208
> Description:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: The job fails. It can't determinate if the
> property (Domain\User) of de job "Copia de seguridad master" have access t
o
> de server (reasolt: It can't conect to the server, check the error log in
SQL
> Server and the SQL Server Agent)
> This error ocours when I backup all the data bases, not only with the mast
er
> Thanks
>
Which account is used to run the SQL Server Agent service? This should
be a domain account that has access to the folders/servers where the
backup files is placed.
Regards
Steen|||Hi,
Change the SQL Server Agent service startup account to an account which has
got previlages.
For testing purpose you can first change it to Local system account and
execute the scheduled task
and once u find every thing goes fine then change to a domain OS user which
has got prev. to backup
Thanks
Hari
SQL Server MVP
"P.Burguete" <PBurguete@.discussions.microsoft.com> wrote in message
news:FE7BC385-B6ED-4A63-980C-3500FB304739@.microsoft.com...
> Hello;
> I've problems with the differents data bases backups with SQL SERVER 2000.
> If I launch the backup manualy of the differents data bases I have no
> problem; but when I schedule the backup it fails show me in the event
> viewer
> application this message:
> Origen: SQLSERVERAGENT
> Categoria: Job Engine
> ID: 208
> Descripcin:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: El trabaj fall. No se puede determinar
> si
> el
> propietario (Dominio\Usuario) del trabajo Copia de seguridad master tiene
> acceso al servidor (motivo: No se puede conectar al servidor, compruebe
> los
> registros de errores de SQL Server y del Agente SQL Server).
> I'm spanish, and I have the spanish edtion, I will try to translate the
> message.
> Source: SQLSERVERAGENT
> Category: Job Engine
> ID: 208
> Description:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: The job fails. It can't determinate if the
> property (Domain\User) of de job "Copia de seguridad master" have access
> to
> de server (reasolt: It can't conect to the server, check the error log in
> SQL
> Server and the SQL Server Agent)
> This error ocours when I backup all the data bases, not only with the
> master
> Thanks
>|||Try changing the job owner to sa. I think that this happens when Agent servi
ce account cannot access
enough info in domain to validate the Windows owner of the job. Setting the
owner to a SQL Server
account should take care of that.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"P.Burguete" <PBurguete@.discussions.microsoft.com> wrote in message
news:FE7BC385-B6ED-4A63-980C-3500FB304739@.microsoft.com...
> Hello;
> I've problems with the differents data bases backups with SQL SERVER 2000.
> If I launch the backup manualy of the differents data bases I have no
> problem; but when I schedule the backup it fails show me in the event view
er
> application this message:
> Origen: SQLSERVERAGENT
> Categoria: Job Engine
> ID: 208
> Descripción:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: El trabajó falló. No se puede determinar
si
> el
> propietario (Dominio\Usuario) del trabajo Copia de seguridad master tiene
> acceso al servidor (motivo: No se puede conectar al servidor, compruebe lo
s
> registros de errores de SQL Server y del Agente SQL Server).
> I'm spanish, and I have the spanish edtion, I will try to translate the
> message.
> Source: SQLSERVERAGENT
> Category: Job Engine
> ID: 208
> Description:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: The job fails. It can't determinate if the
> property (Domain\User) of de job "Copia de seguridad master" have access t
o
> de server (reasolt: It can't conect to the server, check the error log in
SQL
> Server and the SQL Server Agent)
> This error ocours when I backup all the data bases, not only with the mast
er
> Thanks
>

Problems with backup

Hello;
I've problems with the differents data bases backups with SQL SERVER 2000.
If I launch the backup manualy of the differents data bases I have no
problem; but when I schedule the backup it fails show me in the event viewer
application this message:
Origen: SQLSERVERAGENT
Categoria: Job Engine
ID: 208
Descripción:
SQL Server Scheduled Job 'Copia de seguridad master'
(0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
2005-09-20 13:14:35 - Message: El trabajó falló. No se puede determinar si
el
propietario (Dominio\Usuario) del trabajo Copia de seguridad master tiene
acceso al servidor (motivo: No se puede conectar al servidor, compruebe los
registros de errores de SQL Server y del Agente SQL Server).
I'm spanish, and I have the spanish edtion, I will try to translate the
message.
Source: SQLSERVERAGENT
Category: Job Engine
ID: 208
Description:
SQL Server Scheduled Job 'Copia de seguridad master'
(0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
2005-09-20 13:14:35 - Message: The job fails. It can't determinate if the
property (Domain\User) of de job "Copia de seguridad master" have access to
de server (reasolt: It can't conect to the server, check the error log in SQL
Server and the SQL Server Agent)
This error ocours when I backup all the data bases, not only with the master
ThanksP.Burguete wrote:
> Hello;
> I've problems with the differents data bases backups with SQL SERVER 2000.
> If I launch the backup manualy of the differents data bases I have no
> problem; but when I schedule the backup it fails show me in the event viewer
> application this message:
> Origen: SQLSERVERAGENT
> Categoria: Job Engine
> ID: 208
> Descripción:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: El trabajó falló. No se puede determinar si
> el
> propietario (Dominio\Usuario) del trabajo Copia de seguridad master tiene
> acceso al servidor (motivo: No se puede conectar al servidor, compruebe los
> registros de errores de SQL Server y del Agente SQL Server).
> I'm spanish, and I have the spanish edtion, I will try to translate the
> message.
> Source: SQLSERVERAGENT
> Category: Job Engine
> ID: 208
> Description:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: The job fails. It can't determinate if the
> property (Domain\User) of de job "Copia de seguridad master" have access to
> de server (reasolt: It can't conect to the server, check the error log in SQL
> Server and the SQL Server Agent)
> This error ocours when I backup all the data bases, not only with the master
> Thanks
>
Which account is used to run the SQL Server Agent service? This should
be a domain account that has access to the folders/servers where the
backup files is placed.
Regards
Steen|||Hi,
Change the SQL Server Agent service startup account to an account which has
got previlages.
For testing purpose you can first change it to Local system account and
execute the scheduled task
and once u find every thing goes fine then change to a domain OS user which
has got prev. to backup
Thanks
Hari
SQL Server MVP
"P.Burguete" <PBurguete@.discussions.microsoft.com> wrote in message
news:FE7BC385-B6ED-4A63-980C-3500FB304739@.microsoft.com...
> Hello;
> I've problems with the differents data bases backups with SQL SERVER 2000.
> If I launch the backup manualy of the differents data bases I have no
> problem; but when I schedule the backup it fails show me in the event
> viewer
> application this message:
> Origen: SQLSERVERAGENT
> Categoria: Job Engine
> ID: 208
> Descripción:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: El trabajó falló. No se puede determinar
> si
> el
> propietario (Dominio\Usuario) del trabajo Copia de seguridad master tiene
> acceso al servidor (motivo: No se puede conectar al servidor, compruebe
> los
> registros de errores de SQL Server y del Agente SQL Server).
> I'm spanish, and I have the spanish edtion, I will try to translate the
> message.
> Source: SQLSERVERAGENT
> Category: Job Engine
> ID: 208
> Description:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: The job fails. It can't determinate if the
> property (Domain\User) of de job "Copia de seguridad master" have access
> to
> de server (reasolt: It can't conect to the server, check the error log in
> SQL
> Server and the SQL Server Agent)
> This error ocours when I backup all the data bases, not only with the
> master
> Thanks
>|||Try changing the job owner to sa. I think that this happens when Agent service account cannot access
enough info in domain to validate the Windows owner of the job. Setting the owner to a SQL Server
account should take care of that.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"P.Burguete" <PBurguete@.discussions.microsoft.com> wrote in message
news:FE7BC385-B6ED-4A63-980C-3500FB304739@.microsoft.com...
> Hello;
> I've problems with the differents data bases backups with SQL SERVER 2000.
> If I launch the backup manualy of the differents data bases I have no
> problem; but when I schedule the backup it fails show me in the event viewer
> application this message:
> Origen: SQLSERVERAGENT
> Categoria: Job Engine
> ID: 208
> Descripción:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: El trabajó falló. No se puede determinar si
> el
> propietario (Dominio\Usuario) del trabajo Copia de seguridad master tiene
> acceso al servidor (motivo: No se puede conectar al servidor, compruebe los
> registros de errores de SQL Server y del Agente SQL Server).
> I'm spanish, and I have the spanish edtion, I will try to translate the
> message.
> Source: SQLSERVERAGENT
> Category: Job Engine
> ID: 208
> Description:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: The job fails. It can't determinate if the
> property (Domain\User) of de job "Copia de seguridad master" have access to
> de server (reasolt: It can't conect to the server, check the error log in SQL
> Server and the SQL Server Agent)
> This error ocours when I backup all the data bases, not only with the master
> Thanks
>

Problems with backup

Hello;
I've problems with the differents data bases backups with SQL SERVER 2000.
If I launch the backup manualy of the differents data bases I have no
problem; but when I schedule the backup it fails show me in the event viewer
application this message:
Origen: SQLSERVERAGENT
Categoria: Job Engine
ID: 208
Descripción:
SQL Server Scheduled Job 'Copia de seguridad master'
(0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
2005-09-20 13:14:35 - Message: El trabajó falló. No se puede determinar si
el
propietario (Dominio\Usuario) del trabajo Copia de seguridad master tiene
acceso al servidor (motivo: No se puede conectar al servidor, compruebe los
registros de errores de SQL Server y del Agente SQL Server).
I'm spanish, and I have the spanish edtion, I will try to translate the
message.
Source: SQLSERVERAGENT
Category: Job Engine
ID: 208
Description:
SQL Server Scheduled Job 'Copia de seguridad master'
(0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
2005-09-20 13:14:35 - Message: The job fails. It can't determinate if the
property (Domain\User) of de job "Copia de seguridad master" have access to
de server (reasolt: It can't conect to the server, check the error log in SQL
Server and the SQL Server Agent)
This error ocours when I backup all the data bases, not only with the master
Thanks
P.Burguete wrote:
> Hello;
> I've problems with the differents data bases backups with SQL SERVER 2000.
> If I launch the backup manualy of the differents data bases I have no
> problem; but when I schedule the backup it fails show me in the event viewer
> application this message:
> Origen: SQLSERVERAGENT
> Categoria: Job Engine
> ID: 208
> Descripción:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: El trabajó falló. No se puede determinar si
> el
> propietario (Dominio\Usuario) del trabajo Copia de seguridad master tiene
> acceso al servidor (motivo: No se puede conectar al servidor, compruebe los
> registros de errores de SQL Server y del Agente SQL Server).
> I'm spanish, and I have the spanish edtion, I will try to translate the
> message.
> Source: SQLSERVERAGENT
> Category: Job Engine
> ID: 208
> Description:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: The job fails. It can't determinate if the
> property (Domain\User) of de job "Copia de seguridad master" have access to
> de server (reasolt: It can't conect to the server, check the error log in SQL
> Server and the SQL Server Agent)
> This error ocours when I backup all the data bases, not only with the master
> Thanks
>
Which account is used to run the SQL Server Agent service? This should
be a domain account that has access to the folders/servers where the
backup files is placed.
Regards
Steen
|||Hi,
Change the SQL Server Agent service startup account to an account which has
got previlages.
For testing purpose you can first change it to Local system account and
execute the scheduled task
and once u find every thing goes fine then change to a domain OS user which
has got prev. to backup
Thanks
Hari
SQL Server MVP
"P.Burguete" <PBurguete@.discussions.microsoft.com> wrote in message
news:FE7BC385-B6ED-4A63-980C-3500FB304739@.microsoft.com...
> Hello;
> I've problems with the differents data bases backups with SQL SERVER 2000.
> If I launch the backup manualy of the differents data bases I have no
> problem; but when I schedule the backup it fails show me in the event
> viewer
> application this message:
> Origen: SQLSERVERAGENT
> Categoria: Job Engine
> ID: 208
> Descripcin:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: El trabaj fall. No se puede determinar
> si
> el
> propietario (Dominio\Usuario) del trabajo Copia de seguridad master tiene
> acceso al servidor (motivo: No se puede conectar al servidor, compruebe
> los
> registros de errores de SQL Server y del Agente SQL Server).
> I'm spanish, and I have the spanish edtion, I will try to translate the
> message.
> Source: SQLSERVERAGENT
> Category: Job Engine
> ID: 208
> Description:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: The job fails. It can't determinate if the
> property (Domain\User) of de job "Copia de seguridad master" have access
> to
> de server (reasolt: It can't conect to the server, check the error log in
> SQL
> Server and the SQL Server Agent)
> This error ocours when I backup all the data bases, not only with the
> master
> Thanks
>
|||Try changing the job owner to sa. I think that this happens when Agent service account cannot access
enough info in domain to validate the Windows owner of the job. Setting the owner to a SQL Server
account should take care of that.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"P.Burguete" <PBurguete@.discussions.microsoft.com> wrote in message
news:FE7BC385-B6ED-4A63-980C-3500FB304739@.microsoft.com...
> Hello;
> I've problems with the differents data bases backups with SQL SERVER 2000.
> If I launch the backup manualy of the differents data bases I have no
> problem; but when I schedule the backup it fails show me in the event viewer
> application this message:
> Origen: SQLSERVERAGENT
> Categoria: Job Engine
> ID: 208
> Descripción:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: El trabajó falló. No se puede determinar si
> el
> propietario (Dominio\Usuario) del trabajo Copia de seguridad master tiene
> acceso al servidor (motivo: No se puede conectar al servidor, compruebe los
> registros de errores de SQL Server y del Agente SQL Server).
> I'm spanish, and I have the spanish edtion, I will try to translate the
> message.
> Source: SQLSERVERAGENT
> Category: Job Engine
> ID: 208
> Description:
> SQL Server Scheduled Job 'Copia de seguridad master'
> (0xE038C2FDE1799C45ABB23A45F46B4BF4) - Status: Error - Invoked on:
> 2005-09-20 13:14:35 - Message: The job fails. It can't determinate if the
> property (Domain\User) of de job "Copia de seguridad master" have access to
> de server (reasolt: It can't conect to the server, check the error log in SQL
> Server and the SQL Server Agent)
> This error ocours when I backup all the data bases, not only with the master
> Thanks
>

problems with average calculations that do not give correct value

I am currently building a cube and I have two measures that I need to calculate the average for (i.e. columns measureA and measureB).

measureA is a Sum of a value and measureB is the count of the number of occurences of the value.

I define a calculated Member that employs the calculation of measureA/measureB. This gives me an average that I want to roll up.

At the lowest level the calulation is correct, however as the rollups happen the calcultion becomes invalid. At the (all) level the calculation is quite far out.

The calculated member simply gives me the (All)measureA/(All)measureB.

Can anyone point me in the direction of how I can get a calculation of the individual measureA/measureB rolled up correctly giving me an overall average?

COUNT takes into account empty cells, so when you rollup, you are considering more cells than you should.

Use AVG, or filter out empty cells when using COUNT

See

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=390791&SiteID=1

Hope this helps,

Santi

|||

Thanks Santi That did help me.

What I was trying to do was more complex than simply averaging a single column data and after studying the problem I found that it was far too complex and that using Avg was much better.

Many thanks

Rob

Problems With Automated Jobs

Hi guys

I have setup a sequence of jobs to run maintenance on one of our SQL Servers.

The sequence of jobs is as follows:

Backup database
Archive database
Recreate indexes
Shrink database
Update statistics
Backup database

There is also another step which is Restore Database. This step is only called if the Archive, Re-index or Shrink jobs fail.

I made a slight script error and so when the job ran on Sunday it deemed the job a failure and attempted to restore the database, that wasn't a problem as the error was deliberate to test the restore process.

The restore process failed and logged the following message:

Job 'Sunday Maintenance - Full' : Step 8, 'Restore Database' : Began Executing 08/02/04 22:58:40

Msg 3101, Sev 16: Database in use. The system administrator must have exclusive use of the database to run the restore operation. [SQLSTATE 42000]
Msg 3013, Sev 16: Backup or restore operation terminating abnormally. [SQLSTATE 42000]

The syntax I used to do the restore was:

RESTORE DATABASE Emvolve
FROM DISK = 'H:\Dbdata\Backup\Emvolve_Full_Before.BAK'
WITH REPLACE

How do I get around this error message to complete the restore automatically? Any services that access this database are stopped prior to this process running so nothign should be accessing SQL.

Any ideas would be appreciated as I am only a learner as far as SQl goes.

Cheers

Paul

:)One of the reasons why automating a restore process is not a good idea is because all users will have to log off first before you can restore the database. Just imagine someone who may lose hours of work because a restore was performed. Restore, especially overwriting the existing database, should be carried out manually with caution unless you are restoring database backup to a test machine. Of course, you can write a script to kill all existing users on the database and achieve your goal but it's always dangerous to do it that way.|||Thanks for the reply

When these jobs are initiated there are other batch files wich are ran to disconnect any users from the system. There are no users using the system from the desktop end as the IIS is stopped prior to the maintenance jobs running.

Maybe I will remove the restore step and have this ran manually|||What database is the job running under? Probably the one you what to restore to...

Why do you want to restore?

I didn't catch that part...

I resotre a prod db nightly to dev for support...

Try:

ALTER DATABASE dbname SET SINGLE_USER WITH ROLLBACK IMMEDIATE

from another database...before the restore...

Problems with Autogrowth feature

I cannot via SSMS change the autogrowth setting for a database. It is currently set to restricted and I want it set to unrestricted. I make the change, click ok and no error appears but when I open it again the change is not there.

I also tried creating a new database and noticed that the autogrowth setting of unrestricted is not copied from the model db to the new one.

This happens only with the log file. I have SQL 2005 SP1. Any help is appreciated.

What recovery model are you using, Simple or Full?|||I'm using Full recovery mode.|||

Hi Heather,

The maximum size for a log file in 2005 is 2TB. I'm betting that although filesize is displaying as "restricted", the MAXSIZE is indeed 2TB (2,097,152MB). So, within the confines of capacity limitations, it is unlimited so to speak

Cheers,
Rob

Problems with Autogrowth feature

I cannot via SSMS change the autogrowth setting for a database. It is currently set to restricted and I want it set to unrestricted. I make the change, click ok and no error appears but when I open it again the change is not there.

I also tried creating a new database and noticed that the autogrowth setting of unrestricted is not copied from the model db to the new one.

This happens only with the log file. I have SQL 2005 SP1. Any help is appreciated.

What recovery model are you using, Simple or Full?|||I'm using Full recovery mode.|||

Hi Heather,

The maximum size for a log file in 2005 is 2TB. I'm betting that although filesize is displaying as "restricted", the MAXSIZE is indeed 2TB (2,097,152MB). So, within the confines of capacity limitations, it is unlimited so to speak

Cheers,
Rob

Problems with authentication

I'm having trouble getting 2 servers to be able to use nt authentication to access the port mirroring is running on. Right now it keeps trying to log on as "nt authority\anonymous logon". Both the servers have their services running as the same domain user account and I don't have any problems getting sql to use the account on activities like ad hoc backups. The accounts are local admins on the machines so there shouldn't be a security problem. Weird thing is that we've had it happen in 2 separate environments. Any tips would be helpful.

The fact that the authentication ends up as the Anonymous account indicate a NTLM/Kerberos configuration problem, not an endpoint configuration problem. I recommend you folow the Kerberos troubleshooting guidelines: http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/security/tkerberr.mspx

HTH,
~ Remus

Problems with atached database ...

Hi NG, first sorry for my bad english.
I have created a VB project with uses al local SQL2005Express database and a public SQL2005Express database over the net.
I have added the public server using a stored procedure via 'sp_addlinkedserver' and the public server is set to mixed auth mode.
If I run my project in VisualStudio, everthing works fine, no problems to use functions which get theire data from the public server.
But if i use ClickOnce to instal my application on another pc, first everythink looks fine, sqlexpress was instaled and the application too.
If I start the application I was able to use all functions which connect to the local, attached database, but if I call a function which use the public server over the 'sp_addlinkedserver', I get the following error messsage :

' could not log in user ' ',no trusted sqlconnection for this user ' (sorry, self-translated)

but if I check the connectionstring of the addlinked server he is correct with both, username and pw.
Please could someone be so nice and explain it to me ?
Sincerely,
Oliver Petri.

hi Oliver,

SQLExpress installs by default allowing trusted connections only.. you can modify that behaviour both at install time, providing the SECURITYMODE=SQL parameter to the install wizard or enabling the relative setting if in UI mode, or later, at "run time".. you can use SQL Server Management Studio Express for that.. select the server's node, rx click and access the server's properties.. in the "security" page, modify the "server authentication" to "SQL Server and Windows authentication mode".. restart the instance..

regards

|||Thx for your answer, but that is not the problem. As I post '....the public server is set to mixed auth mode.' I have done this for both servers.
Sincerely,
Oliver Petri.

Problems with assembly accessing LDAP & Registry

Running SSRS 2005, I have a custom assembly that needs to read/browse
the file system, Active Directory, and the registry. I have added the
explicit permissions into the code before the calls ie.
Dim fsec As New FileIOPermission(FileIOPermissionAccess.AllAccess,
strFilePath)
fsec.Assert()
Dim perm As New RegistryPermission(RegistryPermissionAccess.Read,
"HKEY_LOCAL_MACHINE\SOFTWARE\0")
perm.Assert()
Dim dsp As New
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse,
groupLDAP)
dsp.Assert()
I believe I've added the code group entry for my assembly into the
rssrvpolicy.config file in the correct place (first entry in the group
for the zone=MyComputer.)
<CodeGroup class="FirstMatchCodeGroup"
version="1" PermissionSetName="FullTrust"
Name="MyCustomAssemblyCodeGroup"
Description="A special code group for my custom assembly">
<IMembershipCondition class="UrlMembershipCondition" version="1"
Url="D:\Microsoft SQL Server 2005\MSSQL.3\Reporting Services
\ReportServer\bin\UrixRS.dll"/>
</CodeGroup>
The report runs fine in preview (expected), in debugLocal (great), but
returns errors when it is deployed to the server (rats!) Actually, the
file IO runs OK on the server. It's just the LDAP and registry calls
that die. Some other code that does not use protected resources runs
fine so I'm confident that I brought the assembly into the report
correctly.
I've disabled the CAS security and the report still errors on the
server. I also made sure the web.config file has impersonate="true" so
the machine user_id should be passed (The global User!UserID in RS is
showing correctly on the server report). Anyone have any ideas what
the issue may be?Update. I've gotten the registry access to work. The problem I still
have is that I can't access the LDAP. I believe the root of the
problem has to do with I'm not able to use UNC paths in my assembly or
I get a not found error. It can access c:\myfile.txt fine, but it
can't get to \\myserver\myfile.txt.
As before, everything still works fine locally, it's just when I try
to run off the report server that I have the problem.
Has anyone had similar issues using UNC paths in custom assemblies?

Problems with an XML column....?

I have a table with an XML column that stores report definitions. For development purposes I have to delete and reinsert these reports on a fairly regular basis (300+ reports). When I do so, I notice the following: The size of the data file increases by roughly 30MB. The file I am loading the XML from (thru an SSIS package) is only 4MB. If I shrink the database, I can get rid of 20MB, but I still net a 10MB increase. The package gets run frequently. Right now my database is at about 250MB when it should be about 40-50MB. I am trying to avoid having to drop all constraints, truncating the table, and reapplying the constraints. If I disable the step in my package that deals with the XML column, I see no change in the database. It appears to be the DELETE that causes the most damage, as I have tested the package on purely an insert-basis and on a delete-insert-basis. Has anyone seen behavior like this?Since no one has responded in over a month, I am going to close this one out myself. I ended up dropping all of the constraints, truncating, and reapplying the constraints. I still have some growth in my data files but it has slowed considerably. I read that empty pages could be left behind by a DELETE statement, but I have never since file growth like this. Perhaps, SP1 addresses this. I don't know.

Problems with an INSERT SP

Hi folks
I have a SP that inserts a record into a table. The text is as follows:
''''
'
CREATE PROCEDURE [dbo].[procClientAdd]
@.lastname varchar (50),
@.firstname varchar (50) = NULL,
@.othernames varchar (50) = NULL,
@.gender varchar (6),
@.dob smalldatetime,
@.comment varchar (50) = NULL,
@.note varchar (500) = NULL,
@.addr1 varchar (50)=NULL,
@.addr2 varchar (50) = NULL,
@.suburb int = NULL,
@.state varchar (3) = NULL
AS
INSERT INTO Clients (LastName, FirstName, OtherNames, Gender, DateOfBirth,
Comment, Note, AddressLine1, AddressLine2, SuburbID, StateCode)
VALUES (@.lastname, @.firstname, @.othernames, @.gender, @.dob, @.comment,
@.note, @.addr1, @.addr2, @.suburb, @.state)
'''
When I attempt to execute it within SQL Query Analyser, I get the following
message:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near ','.
The EXEC statement is as follows:
EXEC procClientAdd @.lastname = 'Petersen', @.firstname = 'Ross',,@.gender =
'Male', @.dob = 'Novermber 1 1952', @.comment = '?',, @.addr1 = '7Bay Road',,
@.suburb = 1, @.state = 'TAS'
I hope somebody can help - I am using Win XP SP2
Kind regards
Ross PetersenEXEC procClientAdd @.lastname = 'Petersen', @.firstname = 'Ross',,@.gender =
'Male', @.dob = 'Novermber 1 1952', @.comment = '?', @.addr1 = '7Bay Road',
@.suburb = 1, @.state = 'TAS'
This is the correct way. You had too many commas after comment and addr1
Yosh
"Ross" <Ross@.discussions.microsoft.com> wrote in message
news:706EF6DF-5FD3-45E6-9477-E2AEE35F32F2@.microsoft.com...
> Hi folks
> I have a SP that inserts a record into a table. The text is as follows:
> ''''
'
> CREATE PROCEDURE [dbo].[procClientAdd]
> @.lastname varchar (50),
> @.firstname varchar (50) = NULL,
> @.othernames varchar (50) = NULL,
> @.gender varchar (6),
> @.dob smalldatetime,
> @.comment varchar (50) = NULL,
> @.note varchar (500) = NULL,
> @.addr1 varchar (50)=NULL,
> @.addr2 varchar (50) = NULL,
> @.suburb int = NULL,
> @.state varchar (3) = NULL
> AS
> INSERT INTO Clients (LastName, FirstName, OtherNames, Gender, DateOfBirth,
> Comment, Note, AddressLine1, AddressLine2, SuburbID, StateCode)
> VALUES (@.lastname, @.firstname, @.othernames, @.gender, @.dob, @.comment,
> @.note, @.addr1, @.addr2, @.suburb, @.state)
> '''
> When I attempt to execute it within SQL Query Analyser, I get the
> following
> message:
> Server: Msg 170, Level 15, State 1, Line 1
> Line 1: Incorrect syntax near ','.
> The EXEC statement is as follows:
> EXEC procClientAdd @.lastname = 'Petersen', @.firstname = 'Ross',,@.gender =
> 'Male', @.dob = 'Novermber 1 1952', @.comment = '?',, @.addr1 = '7Bay Road',,
> @.suburb = 1, @.state = 'TAS'
> I hope somebody can help - I am using Win XP SP2
> Kind regards
> Ross Petersen|||Hi Yosh
Thanks for the quick reply.
I tried your suggestion & it has helped, but there is a problem still.
the EXEC statement looks like this now:
''
EXEC procClientAdd @.lastname = 'Petersen', @.firstname = 'Ross', @.gender =
'Male', @.dob = 'Novermber 1 1952', @.comment = '?', @.addr1 = '7Bay Road',
@.suburb = 1, @.state = 'TAS'
''
I am now getting the following error msg:
'''
Server: Msg 8114, Level 16, State 4, Procedure procClientAdd, Line 0
Error converting data type varchar to smalldatetime.
''''
I have tried a few permutations of the date section, but the same error
occurs. Is there something wrong with how I am specifying the date?
Kind regards
Ross Petersen
"Yosh" wrote:

> EXEC procClientAdd @.lastname = 'Petersen', @.firstname = 'Ross',,@.gender =
> 'Male', @.dob = 'Novermber 1 1952', @.comment = '?', @.addr1 = '7Bay Road',
> @.suburb = 1, @.state = 'TAS'
> This is the correct way. You had too many commas after comment and addr1
> Yosh
>
> "Ross" <Ross@.discussions.microsoft.com> wrote in message
> news:706EF6DF-5FD3-45E6-9477-E2AEE35F32F2@.microsoft.com...
>
>|||Hi,
"November" is misspelled. Try either
@.dob = 'November 1, 1952'
or
@.dob = '1952-11-01'
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab web site - http://www.rlmueller.net
--
"Ross" <Ross@.discussions.microsoft.com> wrote in message
news:1F6942C3-B180-4627-BC6A-BAB556F67626@.microsoft.com...
> Hi Yosh
> Thanks for the quick reply.
> I tried your suggestion & it has helped, but there is a problem still.
> the EXEC statement looks like this now:
> ''
> EXEC procClientAdd @.lastname = 'Petersen', @.firstname = 'Ross', @.gender =
> 'Male', @.dob = 'Novermber 1 1952', @.comment = '?', @.addr1 = '7Bay Road',
> @.suburb = 1, @.state = 'TAS'
> ''
> I am now getting the following error msg:
> '''
> Server: Msg 8114, Level 16, State 4, Procedure procClientAdd, Line 0
> Error converting data type varchar to smalldatetime.
> ''''
> I have tried a few permutations of the date section, but the same error
> occurs. Is there something wrong with how I am specifying the date?
> Kind regards
> Ross Petersen
>
> "Yosh" wrote:
>
=
Road',
follows:
DateOfBirth,
'Ross',,@.gender =
Road',,|||It is because your date is not valid. Always pass dates like:
declare @.test datetime
set @.test = '1952-11-01'
or
set @.test = '19521101'
which are the standard ways to pass dates. I like the version with dashes,
as it tends to be easier to read.
--
----
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Ross" <Ross@.discussions.microsoft.com> wrote in message
news:1F6942C3-B180-4627-BC6A-BAB556F67626@.microsoft.com...
> Hi Yosh
> Thanks for the quick reply.
> I tried your suggestion & it has helped, but there is a problem still.
> the EXEC statement looks like this now:
> ''
> EXEC procClientAdd @.lastname = 'Petersen', @.firstname = 'Ross', @.gender =
> 'Male', @.dob = 'Novermber 1 1952', @.comment = '?', @.addr1 = '7Bay Road',
> @.suburb = 1, @.state = 'TAS'
> ''
> I am now getting the following error msg:
> '''
> Server: Msg 8114, Level 16, State 4, Procedure procClientAdd, Line 0
> Error converting data type varchar to smalldatetime.
> ''''
> I have tried a few permutations of the date section, but the same error
> occurs. Is there something wrong with how I am specifying the date?
> Kind regards
> Ross Petersen
>
> "Yosh" wrote:
>|||Louis,
The format with hyphens is not standard. The two standard formats are
'19521101' and '1952-11-01T00:00:00'
set nocount on
go
set language French
go
declare @.test datetime
set @.test = '1952-11-01'
select month(@.test)
set @.test = '19521101'
select month(@.test)
set @.test = '1952-11-01T00:00:00'
select month(@.test)
go
set language us_english
go
declare @.test datetime
set @.test = '1952-11-01'
select month(@.test)
set @.test = '19521101'
select month(@.test)
set @.test = '1952-11-01T00:00:00'
select month(@.test)
Steve Kass
Drew University
Louis Davidson wrote:

>It is because your date is not valid. Always pass dates like:
>declare @.test datetime
>set @.test = '1952-11-01'
>or
>set @.test = '19521101'
>which are the standard ways to pass dates. I like the version with dashes,
>as it tends to be easier to read.
>|||So with hyphens is not standard, unless it has time attached? I did not
realize that. I had always assumed that the ISO8601 date would default the
time by definition.
----
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Steve Kass" <skass@.drew.edu> wrote in message
news:%23oNancoYFHA.1368@.tk2msftngp13.phx.gbl...
> Louis,
> The format with hyphens is not standard. The two standard formats are
> '19521101' and '1952-11-01T00:00:00'
>
> set nocount on
> go
> set language French
> go
> declare @.test datetime
> set @.test = '1952-11-01'
> select month(@.test)
> set @.test = '19521101'
> select month(@.test)
> set @.test = '1952-11-01T00:00:00'
> select month(@.test)
> go
> set language us_english
> go
> declare @.test datetime
> set @.test = '1952-11-01'
> select month(@.test)
> set @.test = '19521101'
> select month(@.test)
> set @.test = '1952-11-01T00:00:00'
> select month(@.test)
>
> Steve Kass
> Drew University
> Louis Davidson wrote:
>

Problems with an insert

Ok, I've been looking at my code for a while now and need some help. All this function should do is take the incoming ProductID and String of ChildIDs, then insert a record for each ProductID and ChildID into my table

I have 2 problems with my function right now:

1) Why is my function creating zeros in the first pastthrough the loope for new ProductID passed to my function?


ProductID RelatedProductID
105744 0
0
105744
...and then it's fine

The problem is that the @.str variable is returning zero in the first iteration in my loop

SET @.str = substring(@.tmpstr, 1, @.pos - 1

2) It's inserting dup ChildIDs as you'll see below. You'll see I want to perform 2 inserts (with 2 different relationship types of 2 and 3) because for each parent / child we need a reverse insert with relationshiptype as the third column...don't ask me why, we just do.
Example incoming ChildIDs string looks like this (and this string is not always a fixed length): 105234,105235,105236,105237,105238,105239,105240,105241,105242,105243,105244,105245,105246,105247,105248,105249,105250,105251,105252,105253,105254,105255

The product ID incoming that is passed to this function for example is 106731

Example of the double inserts and zeros that keep happening for a product:

106731 0
0 106731
106731
105234 ?- Double Child 105234 (which I do not want happening)
106731 105234 ?-
106731 105235
106731 105235
106731 105236
106731 105236
106731 105237
106731 105237
106731 105238
106731 105238
106731 105239
106731 105239
106731 105240
106731 105240
106731 105241
106731 105241
106731 105242
106731 105242
106731 105243
106731 105243
106731 105244
106731 105244
106731 105245
106731 105245
106731 105246
106731 105246
106731 105247
106731 105247
106731 105248
106731 105248
106731 105249
106731 105249
106731 105250
106731 105250
106731 105251
106731 105251
106731 105252
106731 105252
106731 105253
106731 105253
106731 105254
106731 105254
106731 105255
105253 106731
105251 106731
105249 106731
105247 106731
105245 106731
105243 106731
105241 106731
105239 106731
105252 106731
105254 106731
105237 106731
105235 106731
105250 106731
105248 106731
105246 106731
105244 106731
105242 106731
105240 106731
105238 106731
105236 106731
105234 106731 <-- Double ChildID 105234
105234 106731 <--
105236 106731
105235 106731
105244 106731
105243 106731
105242 106731
105241 106731
105240 106731
105239 106731
105238 106731
105237 106731
105254 106731
105253 106731
105255 106731
105252 106731
105251 106731
105250 106731
105249 106731
105248 106731
105247 106731
105246 106731
105245 106731

What I should be getting is this instead (example below: ProductID is in bold, ChildID is in blue):

ProductID RelatedProductID RelationshipType

106731 105234 3

105234 106731 2

106731 105235 3

105235 106731 2

106731 105236 3

105236 106731 2

106731 105237 3

105237 106731 2

106731 105238 3

105238 106731 2

106731 105239 3

105239 106731 2

106731 105240 3

105240 106731 2

…and so on


ALTER PROCEDURE [dbo].[Insert_Product_Child_Relationships]
-- Add the parameters for the stored procedure here
@.ProductID bigint,
@.ChildIDList ntext
AS
BEGIN
DECLARE @.pos int,
@.textpos int,
@.chunklen smallint,
@.str nvarchar(4000),
@.tmpstr nvarchar(4000),
@.leftover nvarchar(4000)
SET @.textpos = 1
SET @.leftover = ','
WHILE @.textpos <= datalength(@.ChildIDList) / 2
BEGIN
SET @.chunklen = 4000 - datalength(@.leftover) / 2
SET @.tmpstr = ltrim(@.leftover + substring(@.ChildIDList, @.textpos, @.chunklen))
SET @.textpos = @.textpos + @.chunklen
SET @.pos = charindex(',', @.tmpstr)
WHILE @.pos > 0
BEGIN
SET @.str = substring(@.tmpstr, 1, @.pos - 1)
INSERT INTO ProductRelationship VALUES(@.ProductID, convert(bigint, @.str), 3,'', GetDate(), 3, NULL, NULL, 1, 0)
INSERT INTO ProductRelationship VALUES(convert(bigint, @.str), @.ProductID, 2,'', GetDate(), 3, NULL, NULL, 1, 0)
SET @.tmpstr = ltrim(substring(@.tmpstr, @.pos + 1, len(@.tmpstr)))
SET @.pos = charindex(',', @.tmpstr)
END
SET @.leftover = @.tmpstr
END
END

Schema (just enough to see what's going on)

ProductRelationship

-

ProductID (bigint)

RelatedProductID (bigint)

ProductRelationshipType (int)

It is doing that because you are adding a @.leftover to the beginning of the string, so the first record is nothing.

Change your SET @.tmpstr to:

--SET @.tmpstr = ltrim(@.leftover + substring(@.ChildIDList, @.textpos, @.chunklen))
SET @.tmpstr = ltrim(substring(@.ChildIDList, @.textpos, @.chunklen))|||Thanks Tom, I got so confused. Thanks much, it works great now!

Problems with Aggregate function in ProClarity

The filteremptyrowsand grand total doesn′t work for me in ProClarity 6.3 when I′m using aggregate function. I get the #Error measage in Grand Total.

Could you post the MDX that's generating the error? (View | MDX Editor)

Thanks,
Bryan

Problems with Aggregate Expressions using Scope

Hi, I'm having the following problem when creating a matrix report. I'm trying to get the number of companies contacted per person to display in each cell. I have 3 group rows,

The first group, grpPerson =Fields!PersonID.Value
The second, grpCompany =Fields!CompanyID.Value with parent group = grpPerson
The thrid, grpOffice =Fields!OfficeID.Value with parent group = grpCompany

I have spent numerous hours trying different combinations of adding row groups, adding column groups, tried every possible combenation of aggregate functions, and scops, each give me different results, neither of them are what I am expecting.
Below is an example output of the following expression that I have in my data cell:
=Count(Fields!PersonID.Value, ("grpCompany")

My expected result is the number of rows per person, for the company for each month. i.e person1 called company1 5 times in the month of Feb. So each office should show the same some in the Month of Feb06. I will use this sum later to get the percentage of offices that the person called each month, and this count will alow me to do that.

However, the result below is what's being displayed. It appears the show, in the top row for each company, the number of companies the person called, not filtered by month. Then for the other rows of the company, it's showing the total number of rows returned from the whole dataset. I have tried just about every aggregate function possible. Any help to solve this problem would be great! Thanks!

Feb06 | Mar06 | Apr06 | Total
person1 | company1 | office1 20 20 20 500
| office2 500 500 500 500
| office3 500 500 500 500
person2 | company1 | office1 15 15 15 500
| office2 500 500 500 500
| office3 500 500 500 500

I’m also trying to do this using one dataset without using an aggregate within the SQL query that returns the number of times a person contacted a company each month because it significantly slows it down. I'm trying to do this all within reporting services. Any help to solve this problem would be great! Thanks!
Have you tried just =Count(Fields!PersonID.Value)? When you specify a explicit scope in the aggregate, e.g. grpCompany, it will return the sum for that group, regardless of the month in this case.|||Yes, I have tried Count(Fields!PersonID.Value), and it will give me the correct sum for the specific office of the company for the month, not the company count as a whole for the month. Is this even possible?
|||In that case, you can add a subtotal to the Office row group (right click on the row group and select subtotal). Then in the cells under the subtotal row, you should get the company count for the month.|||Thanks for your help so far, but that will give me the total number of office rows in the query. I'm looking to retrieve the number of rows the query returned per person. ie. person1 had 5 companies, person2 had 15 companies ect.

In addition I would like each cell for the person to be able to display the total value. Once I can do that I will be able to divide the total number of person calls by the number of times a person called an office,

Problems with adding subscriptions

Hi, I hope anyone can help me with this problem!
I have installed RS on Win2k Server with all Servicepacks.
From my client in network i can view all Reports but I can't add new
subscriptions.
On the site "SubscriptionProperties.aspx" the "OK" and "Cancel" Button are
not working.
On my client I use IE 6.2800 with all Servicepacks.
When I connect to RS with Mozilla Firefox then I can create subscriptions.
Strange!Very strange. Can you try deleting you IE cache and see if that changes the
behavior.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Moskito" <moskito@.wecomtec.no-ip.com> wrote in message
news:eEQ3fyypEHA.2764@.TK2MSFTNGP11.phx.gbl...
> Hi, I hope anyone can help me with this problem!
> I have installed RS on Win2k Server with all Servicepacks.
> From my client in network i can view all Reports but I can't add new
> subscriptions.
> On the site "SubscriptionProperties.aspx" the "OK" and "Cancel" Button are
> not working.
> On my client I use IE 6.2800 with all Servicepacks.
> When I connect to RS with Mozilla Firefox then I can create subscriptions.
> Strange!
>
>|||I deleted the cache and all tmp files from IE but nothing
hapens. I have the same problem like before.
>--Original Message--
>Very strange. Can you try deleting you IE cache and see
if that changes the
>behavior.
>--
>-Daniel
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>
>"Moskito" <moskito@.wecomtec.no-ip.com> wrote in message
>news:eEQ3fyypEHA.2764@.TK2MSFTNGP11.phx.gbl...
>> Hi, I hope anyone can help me with this problem!
>> I have installed RS on Win2k Server with all
Servicepacks.
>> From my client in network i can view all Reports but I
can't add new
>> subscriptions.
>> On the site "SubscriptionProperties.aspx" the "OK"
and "Cancel" Button are
>> not working.
>> On my client I use IE 6.2800 with all Servicepacks.
>> When I connect to RS with Mozilla Firefox then I can
create subscriptions.
>> Strange!
>>
>
>.
>

Problems with adding database samples

I have installed the documentation and samples and the management studio for sql 2005 express edition, but when trying to work through the samples, I get this error message, for some reason I can't include the Adventure works db. Whatn I'm I not doing right? Please can someone help!


1> SELECT name from sys.databases
2> Go
name

--

master

tempdb

model

msdb


1> CREATE DATABASE [AdventureWorks] ON
2> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.mdf' ),
3> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.ldf' )
4> FOR ATTACH ;
5> GO
Msg 153, Level 15, State 1, Server YOUR-V7OY5L24PG\SQLEXPRESS, Line 2
Invalid usage of the option AdventureWorks in the CREATE/ALTER DATABASE statemen
t.
1> USE [master]
2> GO
Changed database context to 'master'.
1> CREATE DATABASE [AdventureWorks] ON
2> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.mdf' ),
3> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.ldf' )
4> FOR ATTACH ;
5> GO
Msg 153, Level 15, State 1, Server YOUR-V7OY5L24PG\SQLEXPRESS, Line 2
Invalid usage of the option AdventureWorks in the CREATE/ALTER DATABASE statemen
t.
1> select name from sys.databases
2> go
name

--

master

tempdb

model

msdb


(4 rows affected)
1>

Your create database statement is slightly wrong. If you look at the syntax it is

create database <dbname> ON (Name=<logical name for file>, filename='<filename>')

LOG ON (Name=<logical name for file>, filename='<filename>')

You have combined the logical name for file and filename and ommitted the name and filename keywords.

|||

I am trying to learn SQL 2005 and I am working throught the Microsoft SQL Server 2005 Implementation and Maintenance Training Kit.

I have partitoned out my hard-drive into several partitons.

C,G,H,I,J and K.

Created Sales_Data folders in G,H,I drives

I ran the following code in MSSM Studio:

CREATE DATABASE Sales
ON
PRIMARY
(NAME = 'G:\Sales_Data\SalesPrimary.mdf'
SIZE = 50MB,
MAXSIZE = 200,
FILEGROWTH = 20),
FILEGROUP SalesFG
( NAME = SalesData1,
FILENAME = 'H:\Sales_Data\SalesData1.ndf'
SIZE = 200MB,
MAXSIZE = 800,
FILEGROWTH = 100),
( NAME = SalesData2,
FILENAME = 'H:\Sales_Data\SalesData2.ndf'
SIZE = 400MB,
MAXSIZE = 1200,
FILEGROWTH = 300),
FILEGROUP SalesHistoryFG
( NAME = SalesHistory1,
FILENAME = 'H:\Sales_Data\SalesHistory1.ndf'
SIZE = 100MB
MAXSIZE = 500,
FILEGROWTH = 50)
LOG ON
(NAME = ArchLog1,
FILENAME = 'I:\Sales_Data\SalesLog.ldf',
SIZE = 300MB,
MAXSIZE = 800,
FILEGROWTH = 100)

I am getting the following error message:

Msg 153, Level 15, State 1, Line 5

Invalid usage of the option SIZE in the CREATE/ALTER DATABASE statement.

Any idea as to why it will not except the syntax for the size option? ny help will be greatly appreciated.

|||Just do a basic check. You miss comma before SIZE option.

CREATE DATABASE Sales
ON
PRIMARY
(NAME = 'G:\Sales_Data\SalesPrimary.mdf', <-Here
SIZE = 50MB,
MAXSIZE = 200,
FILEGROWTH = 20),
FILEGROUP SalesFG
( NAME = SalesData1,
FILENAME = 'H:\Sales_Data\SalesData1.ndf', <-Here
SIZE = 200MB,
MAXSIZE = 800,
FILEGROWTH = 100),
( NAME = SalesData2,
FILENAME = 'H:\Sales_Data\SalesData2.ndf', <--Here
SIZE = 400MB,
MAXSIZE = 1200,
FILEGROWTH = 300),
FILEGROUP SalesHistoryFG
( NAME = SalesHistory1,
FILENAME = 'H:\Sales_Data\SalesHistory1.ndf', <--Here
SIZE = 100MB, <--And here
MAXSIZE = 500,
FILEGROWTH = 50)
LOG ON
(NAME = ArchLog1,
FILENAME = 'I:\Sales_Data\SalesLog.ldf',
SIZE = 300MB,
MAXSIZE = 800,
FILEGROWTH = 100)


Thanks,
Zuomin

Problems with adding database samples

I have installed the documentation and samples and the management studio for sql 2005 express edition, but when trying to work through the samples, I get this error message, for some reason I can't include the Adventure works db. Whatn I'm I not doing right? Please can someone help!


1> SELECT name from sys.databases
2> Go
name

--

master

tempdb

model

msdb


1> CREATE DATABASE [AdventureWorks] ON
2> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.mdf' ),
3> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.ldf' )
4> FOR ATTACH ;
5> GO
Msg 153, Level 15, State 1, Server YOUR-V7OY5L24PG\SQLEXPRESS, Line 2
Invalid usage of the option AdventureWorks in the CREATE/ALTER DATABASE statemen
t.
1> USE [master]
2> GO
Changed database context to 'master'.
1> CREATE DATABASE [AdventureWorks] ON
2> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.mdf' ),
3> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.ldf' )
4> FOR ATTACH ;
5> GO
Msg 153, Level 15, State 1, Server YOUR-V7OY5L24PG\SQLEXPRESS, Line 2
Invalid usage of the option AdventureWorks in the CREATE/ALTER DATABASE statemen
t.
1> select name from sys.databases
2> go
name

--

master

tempdb

model

msdb


(4 rows affected)
1>

Your create database statement is slightly wrong. If you look at the syntax it is

create database <dbname> ON (Name=<logical name for file>, filename='<filename>')

LOG ON (Name=<logical name for file>, filename='<filename>')

You have combined the logical name for file and filename and ommitted the name and filename keywords.

Problems with adding data to wider table

I want to insert a record with fields let say"ProductCode, Name" to a table with records like "ProductCode, Name, NumberofItems". I get mismatching errors "Conversion from string "INSERT INTO dbo.t_Shopping(Productcod" to type 'Double' is not valid.". Note the missing last letter. ProductCode and Name are both varChars, NumberofItems is int in table and double in my code.

This is my insertion script ".CommandType = CommandType.Text = "INSERT INTO dbo.t_Shopping(ProductCode, Name, NumberofItems)SELECT ProductCode, Name, @.NumberofItems FROM dbo.t_Product WHERE ProductCode=@.ProductCode"

I have asked this question previously in an other mail, but probably because that thread was marked solved, no one answered.

The whole code is like this: I translated some names. I hope its still valid.

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim NumberofItems As Double = 1
Dim conn As New SqlConnection("Data Source=DV2\SQLEXPRESS;Initial Catalog=testaus;Integrated Security=True")
Dim row As DetailsViewRow = DetailsView1.Rows(0)
Dim ProductCode As String = row.Cells(1).Text
Dim cmd As New Data.SqlClient.SqlCommand
Dim param As New SqlParameter()

TextBox1.Text = ProductCode

With cmd
.Connection = conn
.CommandType = CommandType.Text = "INSERT INTO dbo.t_Shopping(ProductCode, Name, NumberofItems)SELECT ProductCode, Name, @.NumberofItems_
FROM dbo.t_Product WHERE ProductCode=@.ProductCode"


.Parameters.AddWithValue("@.ProductCode", ProductCode)
.Parameters.AddWithValue("@.NumberofItems", NumberofItems) '
End With
Try
conn.Open()
cmd.ExecuteNonQuery()
Catch ex As Data.SqlClient.SqlException
Throw New ApplicationException("An error occurred while trying to insert the record")
Finally
conn.Dispose()
End Try

Regards

Leif

My Sql command code had problems, probably. I tried this (see below), but got still more unclearer error. "Incorrect syntax near ','.".I dont know if the problem is in sql query string or in code using 2 parameters,or in wrong variable types.

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim NumberofItems As Integer = 1
Dim luku As Integer
Dim conn As New SqlConnection("Data Source=DV2\SQLEXPRESS;Initial Catalog=testaus;Integrated Security=True")
Dim row As DetailsViewRow = DetailsView1.Rows(0)
Dim ProductCode As String = row.Cells(1).Text

TextBox1.Text = ProductCode

Dim cmd As New SqlCommand("insert dbo.t_Shopping (ProductCode, Name, NumberofItems) select (ProductCode, Name,@.NumberofItems) FROM dbo.t_Product_
WHERE ProductCode=@.ProductCode", conn)

Dim partk, paramaar As New SqlParameter()
partk.Value = ProductCode
partk.SqlDbType = SqlDbType.VarChar
partk.Direction = ParameterDirection.Input
partk.ParameterName = "@.ProductCode"
cmd.Parameters.Add(partk)
paramaar.Value = NumberofItems
paramaar.SqlDbType = SqlDbType.Int
paramaar.Direction = ParameterDirection.Input
paramaar.ParameterName = "@.NumberofItems"
cmd.Parameters.Add(paramaar)
cmd.Connection.Open()
luku = cmd.ExecuteNonQuery() 'This gives errors
cmd.Connection.Close()

End Sub

Leif

|||

LISM:


Dim cmd As New SqlCommand("insert dbo.t_Shopping (ProductCode, Name, NumberofItems) select (ProductCode, Name,@.NumberofItems) FROM dbo.t_Product_
WHERE ProductCode=@.ProductCode", conn)

First, remove the () from the select query.

Second, make sure all the parameters are actually having some values.

Hope this will help.

|||

Thanks

Is there difference between NumberofItems and @.NumberofItems and so on. Variables without @. have a value, but with them don't. Besides, I now tried to @.NumberofItems =NumberofItems and it didn't help (got errors).

Whats next?

Leif


|||

It depends on what you want to use. @.NumberofItems seems to be what user typed in and NumberofItems seems to be coming from the table.. so its your call on which should go into the table.

|||

Thank you for an answer

It looks like I have misunderstood this.

NumberOfItem comes now from code. Its value is 1 now. And yes, someday it may come from the user. Then I try to put it in the Shopping table. I try to do it this way because in Shopping table there is an extra field called NumberofItems. Shopping is a shopping basket and it should contain amount field. The Product table is really a list of names and codes.

Query should work so that it looks for an iten whose code is in ProductCode or @.ProductCode. And then copies that some fields of that record plus NumberOfItems field to shopping basket.

I don't really know where the problem is, in code or in query.

Regards

Leif

|||

Just change your query to

INSERTdbo.t_Shopping (ProductCode, Name, NumberofItems)

SELECT ProductCode, Name,@.NumberofItems

FROMdbo.t_Product

WHERE ProductCode=@.ProductCode

as dhimant suggested and it would work.

|||

Sorry about the mess. But it works!

There was still some problem with code or query, and I wanted to ask more help. Anyway I tried the query in this code, and at first I got errors:"Incorrect syntax near ')'. This is my code without translation. I left out name field to get shorter lines. Tuotekoodi=Productcode, Osto~Shopping, Maara=numberOfItems and so on.

Dim cmd As New SqlCommand("INSERT dbo.t_Osto (Tuotekoodi, Maara) SELECT Tuotekoodi,@.Maara FROM dbo.t_Tuote WHERE Tuotekoodi=@.Tuotekoodi", conn)
cmd.Parameters.Add("@.Maara", SqlDbType.Int)
cmd.Parameters.Add("@.Tuotekoodi", SqlDbType.VarChar)
conn.Open()
cmd.Parameters("@.Tuotekoodi").Value = Tuotekoodi
cmd.Parameters("@.Maara").Value = Maara
luku = cmd.ExecuteNonQuery()
conn.Close()

The most difficult and interesting part was the fact that the IDE inserted some extra brackets () . I copy/pasted your code to an empty place in my code, and got many errors, thats ok. But at the same time IDE inserted couple of pairs of brackets there. And then I pasted the code with extra brackets to my code. That was quite difficult to see. I tend to trust Copy/paste. A nasty feature?

Probably that spoiled my earlier attempts, also.

And lets not forget, it works, thanks.


Leif

Problems with Active Directory

I'm having a problem using SQL Server Reporting Services in a deployment of a
project which makes use of an assembly which reads from an Active Directory
attribute.
I'm trying to read an Active Directory attribute using a class created in
VB.NET, the following is the code used:
Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As
String) As String
Try
Dim sPath As String = "LDAP://Dominio" '' Dominio donde se buscara
Dim SamAccount As String = Right(inSAM, Len(inSAM) - InStr(inSAM,
"\")) ''' Usuario que se buscara
Dim myDirectory As New DirectoryEntry(sPath, "dominio\user",
"password") 'pass the user account and password for your Enterprise admin.
Dim mySearcher As New DirectorySearcher(myDirectory)
Dim mySearchResultColl As SearchResultCollection
Dim mySearchResult As SearchResult
Dim myResultPropColl As ResultPropertyCollection
Dim myResultPropValueColl As ResultPropertyValueCollection
'Build LDAP query
mySearcher.Filter = ("(&(objectClass=user)(samaccountname=" &
SamAccount & "))")
mySearchResultColl = mySearcher.FindAll()
'I expect only one user from search result
Select Case mySearchResultColl.Count
Case 0
Return "Null"
Exit Function
Case Is > 1
Return "Null"
Exit Function
End Select
'Get the search result from the collection
mySearchResult = mySearchResultColl.Item(0)
'Get the Properites, they contain the usefull info
myResultPropColl = mySearchResult.Properties
'displayname, mail
'Retrieve from the properties collection the display name and
email of the user
myResultPropValueColl = myResultPropColl.Item(inType)
Return CStr(myResultPropValueColl.Item(0))
Catch ex As System.Exception
'do some error return here.
End Try
End Function
The class seems work correct in Design View, but when I try to deply, a host
assembly security error is displayed. I understand one has to modify the
configuration files of Reporting Services en enable correct security,
(rssrvpolicy.config and rspreviewpolicy.config), I've done this but am seeing
the
same error. Also, I've copied the dll file of the assembly to the /bin
directory of
Reporting Serivices and to the Report Designer directory as indicated, but
still no luck with the error.
Permissions seem to be set correcty in the Virtual Directory of Reporting
Services.
For the Deployment, I've set up the project properties as follows:
OverwriteDateSources=True
TargetFolder=pruebadll
TargetServerURL=http://lopezcarlos/reportserver
In the configuration files I've setup in the following manner, apparantely
it's not
working:
<CodeGroup
class="UnionCodeGroup"
version="1"
Unrestricted="true"
PermissionSetName="FullTrust"
Name="MyCustomAssemblyCodeGroup"
Description="Codigo especial para leer el active directory">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\MyCustomAssembly.dll" />
</CodeGroup>
In the Property References section of the report, a reference to itself is
made,
and in the preview of Visual Studio .NET 2003 the reports is visualized
correctly.
the problem occurs in the deployment process.
When deployed, the report displays the following error:
Error on loading the host assembly. Details: Security Error
(rsProcessingError)
The following link has the information I've used to do the design of the
report,:
http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
Thanks for the help.Carlos,
Try this:
1. In the rssrvpolicy.config, create a new PermissionSet class containing
the DirectoryServicesPermission and associate your assembly with similar to
the thread
http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
or
http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
In your case, you won't be using FileIOPermission but
DirectoryServicesPermission
2. In your assembly before the FindAll call assert the
DirectoryServicesPermission
Dim ps As New PermissionSet(PermissionState.None)
Dim dsp As DirectoryServicesPermission
dsp = New
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
ps.AddPermission(dsp)
' Stop security checks at this point in the stack walk for the specified
permissions
ps.Assert()
3. Reading the documentation on DirectorySearcher, you may need to add the
AllowPartiallyTrustedCallers attribute to your custom assembly.
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> I'm having a problem using SQL Server Reporting Services in a deployment
of a
> project which makes use of an assembly which reads from an Active
Directory
> attribute.
> I'm trying to read an Active Directory attribute using a class created in
> VB.NET, the following is the code used:
> Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As
> String) As String
> Try
> Dim sPath As String = "LDAP://Dominio" '' Dominio donde se
buscara
> Dim SamAccount As String = Right(inSAM, Len(inSAM) -
InStr(inSAM,
> "\")) ''' Usuario que se buscara
> Dim myDirectory As New DirectoryEntry(sPath, "dominio\user",
> "password") 'pass the user account and password for your Enterprise admin.
> Dim mySearcher As New DirectorySearcher(myDirectory)
> Dim mySearchResultColl As SearchResultCollection
> Dim mySearchResult As SearchResult
> Dim myResultPropColl As ResultPropertyCollection
> Dim myResultPropValueColl As ResultPropertyValueCollection
> 'Build LDAP query
> mySearcher.Filter = ("(&(objectClass=user)(samaccountname=" &
> SamAccount & "))")
> mySearchResultColl = mySearcher.FindAll()
> 'I expect only one user from search result
> Select Case mySearchResultColl.Count
> Case 0
> Return "Null"
> Exit Function
> Case Is > 1
> Return "Null"
> Exit Function
> End Select
> 'Get the search result from the collection
> mySearchResult = mySearchResultColl.Item(0)
> 'Get the Properites, they contain the usefull info
> myResultPropColl = mySearchResult.Properties
> 'displayname, mail
> 'Retrieve from the properties collection the display name and
> email of the user
> myResultPropValueColl = myResultPropColl.Item(inType)
> Return CStr(myResultPropValueColl.Item(0))
> Catch ex As System.Exception
> 'do some error return here.
> End Try
> End Function
> The class seems work correct in Design View, but when I try to deply, a
host
> assembly security error is displayed. I understand one has to modify the
> configuration files of Reporting Services en enable correct security,
> (rssrvpolicy.config and rspreviewpolicy.config), I've done this but am
seeing
> the
> same error. Also, I've copied the dll file of the assembly to the /bin
> directory of
> Reporting Serivices and to the Report Designer directory as indicated, but
> still no luck with the error.
> Permissions seem to be set correcty in the Virtual Directory of Reporting
> Services.
> For the Deployment, I've set up the project properties as follows:
> OverwriteDateSources=True
> TargetFolder=pruebadll
> TargetServerURL=http://lopezcarlos/reportserver
> In the configuration files I've setup in the following manner, apparantely
> it's not
> working:
> <CodeGroup
> class="UnionCodeGroup"
> version="1"
> Unrestricted="true"
> PermissionSetName="FullTrust"
> Name="MyCustomAssemblyCodeGroup"
> Description="Codigo especial para leer el active directory">
> <IMembershipCondition
> class="UrlMembershipCondition"
> version="1"
> Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> Services\ReportServer\bin\MyCustomAssembly.dll" />
> </CodeGroup>
> In the Property References section of the report, a reference to itself is
> made,
> and in the preview of Visual Studio .NET 2003 the reports is visualized
> correctly.
> the problem occurs in the deployment process.
> When deployed, the report displays the following error:
> Error on loading the host assembly. Details: Security Error
> (rsProcessingError)
> The following link has the information I've used to do the design of the
> report,:
> http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> Thanks for the help.
>|||Hi Teo.
I try to do that, but i can't write the followin lines of code:
Dim ps As New PermissionSet(PermissionState.None)
Dim dsp As DirectoryServicesPermission
dsp = New
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
ps.AddPermission(dsp)
ps.Assert()
Need import some assembly'
Thanks.
"Teo Lachev [MVP]" wrote:
> Carlos,
> Try this:
> 1. In the rssrvpolicy.config, create a new PermissionSet class containing
> the DirectoryServicesPermission and associate your assembly with similar to
> the thread
> http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> or
> http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> In your case, you won't be using FileIOPermission but
> DirectoryServicesPermission
> 2. In your assembly before the FindAll call assert the
> DirectoryServicesPermission
> Dim ps As New PermissionSet(PermissionState.None)
> Dim dsp As DirectoryServicesPermission
> dsp = New
> DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> ps.AddPermission(dsp)
> ' Stop security checks at this point in the stack walk for the specified
> permissions
> ps.Assert()
> 3. Reading the documentation on DirectorySearcher, you may need to add the
> AllowPartiallyTrustedCallers attribute to your custom assembly.
>
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > I'm having a problem using SQL Server Reporting Services in a deployment
> of a
> > project which makes use of an assembly which reads from an Active
> Directory
> > attribute.
> >
> > I'm trying to read an Active Directory attribute using a class created in
> > VB.NET, the following is the code used:
> > Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As
> > String) As String
> > Try
> > Dim sPath As String = "LDAP://Dominio" '' Dominio donde se
> buscara
> > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> InStr(inSAM,
> > "\")) ''' Usuario que se buscara
> > Dim myDirectory As New DirectoryEntry(sPath, "dominio\user",
> > "password") 'pass the user account and password for your Enterprise admin.
> > Dim mySearcher As New DirectorySearcher(myDirectory)
> > Dim mySearchResultColl As SearchResultCollection
> > Dim mySearchResult As SearchResult
> > Dim myResultPropColl As ResultPropertyCollection
> > Dim myResultPropValueColl As ResultPropertyValueCollection
> > 'Build LDAP query
> > mySearcher.Filter = ("(&(objectClass=user)(samaccountname=" &
> > SamAccount & "))")
> > mySearchResultColl = mySearcher.FindAll()
> > 'I expect only one user from search result
> > Select Case mySearchResultColl.Count
> > Case 0
> > Return "Null"
> > Exit Function
> > Case Is > 1
> > Return "Null"
> > Exit Function
> > End Select
> > 'Get the search result from the collection
> > mySearchResult = mySearchResultColl.Item(0)
> > 'Get the Properites, they contain the usefull info
> > myResultPropColl = mySearchResult.Properties
> > 'displayname, mail
> > 'Retrieve from the properties collection the display name and
> > email of the user
> > myResultPropValueColl = myResultPropColl.Item(inType)
> > Return CStr(myResultPropValueColl.Item(0))
> > Catch ex As System.Exception
> > 'do some error return here.
> > End Try
> > End Function
> > The class seems work correct in Design View, but when I try to deply, a
> host
> > assembly security error is displayed. I understand one has to modify the
> > configuration files of Reporting Services en enable correct security,
> > (rssrvpolicy.config and rspreviewpolicy.config), I've done this but am
> seeing
> > the
> > same error. Also, I've copied the dll file of the assembly to the /bin
> > directory of
> > Reporting Serivices and to the Report Designer directory as indicated, but
> > still no luck with the error.
> > Permissions seem to be set correcty in the Virtual Directory of Reporting
> > Services.
> > For the Deployment, I've set up the project properties as follows:
> > OverwriteDateSources=True
> > TargetFolder=pruebadll
> > TargetServerURL=http://lopezcarlos/reportserver
> > In the configuration files I've setup in the following manner, apparantely
> > it's not
> > working:
> > <CodeGroup
> > class="UnionCodeGroup"
> > version="1"
> > Unrestricted="true"
> > PermissionSetName="FullTrust"
> > Name="MyCustomAssemblyCodeGroup"
> > Description="Codigo especial para leer el active directory">
> > <IMembershipCondition
> > class="UrlMembershipCondition"
> > version="1"
> > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > </CodeGroup>
> > In the Property References section of the report, a reference to itself is
> > made,
> > and in the preview of Visual Studio .NET 2003 the reports is visualized
> > correctly.
> > the problem occurs in the deployment process.
> > When deployed, the report displays the following error:
> > Error on loading the host assembly. Details: Security Error
> > (rsProcessingError)
> >
> > The following link has the information I've used to do the design of the
> > report,:
> > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > Thanks for the help.
> >
>
>|||Yes, System.DirectoryServices
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> Hi Teo.
> I try to do that, but i can't write the followin lines of code:
> Dim ps As New PermissionSet(PermissionState.None)
> Dim dsp As DirectoryServicesPermission
> dsp = New
> DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> ps.AddPermission(dsp)
> ps.Assert()
> Need import some assembly'
> Thanks.
>
> "Teo Lachev [MVP]" wrote:
> > Carlos,
> >
> > Try this:
> >
> > 1. In the rssrvpolicy.config, create a new PermissionSet class
containing
> > the DirectoryServicesPermission and associate your assembly with similar
to
> > the thread
> >
http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> >
> > or
> >
> >
http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> >
> > In your case, you won't be using FileIOPermission but
> > DirectoryServicesPermission
> >
> > 2. In your assembly before the FindAll call assert the
> > DirectoryServicesPermission
> >
> > Dim ps As New PermissionSet(PermissionState.None)
> > Dim dsp As DirectoryServicesPermission
> >
> > dsp = New
> > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > ps.AddPermission(dsp)
> >
> > ' Stop security checks at this point in the stack walk for the specified
> > permissions
> > ps.Assert()
> >
> > 3. Reading the documentation on DirectorySearcher, you may need to add
the
> > AllowPartiallyTrustedCallers attribute to your custom assembly.
> >
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > I'm having a problem using SQL Server Reporting Services in a
deployment
> > of a
> > > project which makes use of an assembly which reads from an Active
> > Directory
> > > attribute.
> > >
> > > I'm trying to read an Active Directory attribute using a class created
in
> > > VB.NET, the following is the code used:
> > > Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As
> > > String) As String
> > > Try
> > > Dim sPath As String = "LDAP://Dominio" '' Dominio donde se
> > buscara
> > > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> > InStr(inSAM,
> > > "\")) ''' Usuario que se buscara
> > > Dim myDirectory As New DirectoryEntry(sPath,
"dominio\user",
> > > "password") 'pass the user account and password for your Enterprise
admin.
> > > Dim mySearcher As New DirectorySearcher(myDirectory)
> > > Dim mySearchResultColl As SearchResultCollection
> > > Dim mySearchResult As SearchResult
> > > Dim myResultPropColl As ResultPropertyCollection
> > > Dim myResultPropValueColl As ResultPropertyValueCollection
> > > 'Build LDAP query
> > > mySearcher.Filter = ("(&(objectClass=user)(samaccountname="
&
> > > SamAccount & "))")
> > > mySearchResultColl = mySearcher.FindAll()
> > > 'I expect only one user from search result
> > > Select Case mySearchResultColl.Count
> > > Case 0
> > > Return "Null"
> > > Exit Function
> > > Case Is > 1
> > > Return "Null"
> > > Exit Function
> > > End Select
> > > 'Get the search result from the collection
> > > mySearchResult = mySearchResultColl.Item(0)
> > > 'Get the Properites, they contain the usefull info
> > > myResultPropColl = mySearchResult.Properties
> > > 'displayname, mail
> > > 'Retrieve from the properties collection the display name
and
> > > email of the user
> > > myResultPropValueColl = myResultPropColl.Item(inType)
> > > Return CStr(myResultPropValueColl.Item(0))
> > > Catch ex As System.Exception
> > > 'do some error return here.
> > > End Try
> > > End Function
> > > The class seems work correct in Design View, but when I try to deply,
a
> > host
> > > assembly security error is displayed. I understand one has to modify
the
> > > configuration files of Reporting Services en enable correct security,
> > > (rssrvpolicy.config and rspreviewpolicy.config), I've done this but am
> > seeing
> > > the
> > > same error. Also, I've copied the dll file of the assembly to the /bin
> > > directory of
> > > Reporting Serivices and to the Report Designer directory as indicated,
but
> > > still no luck with the error.
> > > Permissions seem to be set correcty in the Virtual Directory of
Reporting
> > > Services.
> > > For the Deployment, I've set up the project properties as follows:
> > > OverwriteDateSources=True
> > > TargetFolder=pruebadll
> > > TargetServerURL=http://lopezcarlos/reportserver
> > > In the configuration files I've setup in the following manner,
apparantely
> > > it's not
> > > working:
> > > <CodeGroup
> > > class="UnionCodeGroup"
> > > version="1"
> > > Unrestricted="true"
> > > PermissionSetName="FullTrust"
> > > Name="MyCustomAssemblyCodeGroup"
> > > Description="Codigo especial para leer el active
directory">
> > > <IMembershipCondition
> > > class="UrlMembershipCondition"
> > > version="1"
> > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > </CodeGroup>
> > > In the Property References section of the report, a reference to
itself is
> > > made,
> > > and in the preview of Visual Studio .NET 2003 the reports is
visualized
> > > correctly.
> > > the problem occurs in the deployment process.
> > > When deployed, the report displays the following error:
> > > Error on loading the host assembly. Details: Security Error
> > > (rsProcessingError)
> > >
> > > The following link has the information I've used to do the design of
the
> > > report,:
> > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > Thanks for the help.
> > >
> >
> >
> >|||Thanks Teo,
This imports (System.DirectoryServices), i already ve added to the project,
but dont solve my problem, can i send my project files?.
Thanks.
"Teo Lachev [MVP]" wrote:
> Yes, System.DirectoryServices
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> > Hi Teo.
> > I try to do that, but i can't write the followin lines of code:
> >
> > Dim ps As New PermissionSet(PermissionState.None)
> > Dim dsp As DirectoryServicesPermission
> >
> > dsp = New
> > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > ps.AddPermission(dsp)
> > ps.Assert()
> >
> > Need import some assembly'
> >
> > Thanks.
> >
> >
> > "Teo Lachev [MVP]" wrote:
> >
> > > Carlos,
> > >
> > > Try this:
> > >
> > > 1. In the rssrvpolicy.config, create a new PermissionSet class
> containing
> > > the DirectoryServicesPermission and associate your assembly with similar
> to
> > > the thread
> > >
> http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> > >
> > > or
> > >
> > >
> http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> > >
> > > In your case, you won't be using FileIOPermission but
> > > DirectoryServicesPermission
> > >
> > > 2. In your assembly before the FindAll call assert the
> > > DirectoryServicesPermission
> > >
> > > Dim ps As New PermissionSet(PermissionState.None)
> > > Dim dsp As DirectoryServicesPermission
> > >
> > > dsp = New
> > > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > ps.AddPermission(dsp)
> > >
> > > ' Stop security checks at this point in the stack walk for the specified
> > > permissions
> > > ps.Assert()
> > >
> > > 3. Reading the documentation on DirectorySearcher, you may need to add
> the
> > > AllowPartiallyTrustedCallers attribute to your custom assembly.
> > >
> > >
> > > --
> > > Hope this helps.
> > >
> > > ---
> > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > Home page and blog: http://www.prologika.com/
> > > ---
> > >
> > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > > I'm having a problem using SQL Server Reporting Services in a
> deployment
> > > of a
> > > > project which makes use of an assembly which reads from an Active
> > > Directory
> > > > attribute.
> > > >
> > > > I'm trying to read an Active Directory attribute using a class created
> in
> > > > VB.NET, the following is the code used:
> > > > Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As
> > > > String) As String
> > > > Try
> > > > Dim sPath As String = "LDAP://Dominio" '' Dominio donde se
> > > buscara
> > > > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> > > InStr(inSAM,
> > > > "\")) ''' Usuario que se buscara
> > > > Dim myDirectory As New DirectoryEntry(sPath,
> "dominio\user",
> > > > "password") 'pass the user account and password for your Enterprise
> admin.
> > > > Dim mySearcher As New DirectorySearcher(myDirectory)
> > > > Dim mySearchResultColl As SearchResultCollection
> > > > Dim mySearchResult As SearchResult
> > > > Dim myResultPropColl As ResultPropertyCollection
> > > > Dim myResultPropValueColl As ResultPropertyValueCollection
> > > > 'Build LDAP query
> > > > mySearcher.Filter = ("(&(objectClass=user)(samaccountname="
> &
> > > > SamAccount & "))")
> > > > mySearchResultColl = mySearcher.FindAll()
> > > > 'I expect only one user from search result
> > > > Select Case mySearchResultColl.Count
> > > > Case 0
> > > > Return "Null"
> > > > Exit Function
> > > > Case Is > 1
> > > > Return "Null"
> > > > Exit Function
> > > > End Select
> > > > 'Get the search result from the collection
> > > > mySearchResult = mySearchResultColl.Item(0)
> > > > 'Get the Properites, they contain the usefull info
> > > > myResultPropColl = mySearchResult.Properties
> > > > 'displayname, mail
> > > > 'Retrieve from the properties collection the display name
> and
> > > > email of the user
> > > > myResultPropValueColl = myResultPropColl.Item(inType)
> > > > Return CStr(myResultPropValueColl.Item(0))
> > > > Catch ex As System.Exception
> > > > 'do some error return here.
> > > > End Try
> > > > End Function
> > > > The class seems work correct in Design View, but when I try to deply,
> a
> > > host
> > > > assembly security error is displayed. I understand one has to modify
> the
> > > > configuration files of Reporting Services en enable correct security,
> > > > (rssrvpolicy.config and rspreviewpolicy.config), I've done this but am
> > > seeing
> > > > the
> > > > same error. Also, I've copied the dll file of the assembly to the /bin
> > > > directory of
> > > > Reporting Serivices and to the Report Designer directory as indicated,
> but
> > > > still no luck with the error.
> > > > Permissions seem to be set correcty in the Virtual Directory of
> Reporting
> > > > Services.
> > > > For the Deployment, I've set up the project properties as follows:
> > > > OverwriteDateSources=True
> > > > TargetFolder=pruebadll
> > > > TargetServerURL=http://lopezcarlos/reportserver
> > > > In the configuration files I've setup in the following manner,
> apparantely
> > > > it's not
> > > > working:
> > > > <CodeGroup
> > > > class="UnionCodeGroup"
> > > > version="1"
> > > > Unrestricted="true"
> > > > PermissionSetName="FullTrust"
> > > > Name="MyCustomAssemblyCodeGroup"
> > > > Description="Codigo especial para leer el active
> directory">
> > > > <IMembershipCondition
> > > > class="UrlMembershipCondition"
> > > > version="1"
> > > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > > </CodeGroup>
> > > > In the Property References section of the report, a reference to
> itself is
> > > > made,
> > > > and in the preview of Visual Studio .NET 2003 the reports is
> visualized
> > > > correctly.
> > > > the problem occurs in the deployment process.
> > > > When deployed, the report displays the following error:
> > > > Error on loading the host assembly. Details: Security Error
> > > > (rsProcessingError)
> > > >
> > > > The following link has the information I've used to do the design of
> the
> > > > report,:
> > > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > > Thanks for the help.
> > > >
> > >
> > >
> > >
>
>|||What is the problem? You cannot compile the project?
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:2F19F79D-5A5B-4971-86F2-5F2B635090C7@.microsoft.com...
> Thanks Teo,
> This imports (System.DirectoryServices), i already ve added to the
project,
> but dont solve my problem, can i send my project files?.
> Thanks.
> "Teo Lachev [MVP]" wrote:
> > Yes, System.DirectoryServices
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> > > Hi Teo.
> > > I try to do that, but i can't write the followin lines of code:
> > >
> > > Dim ps As New PermissionSet(PermissionState.None)
> > > Dim dsp As DirectoryServicesPermission
> > >
> > > dsp = New
> > > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > ps.AddPermission(dsp)
> > > ps.Assert()
> > >
> > > Need import some assembly'
> > >
> > > Thanks.
> > >
> > >
> > > "Teo Lachev [MVP]" wrote:
> > >
> > > > Carlos,
> > > >
> > > > Try this:
> > > >
> > > > 1. In the rssrvpolicy.config, create a new PermissionSet class
> > containing
> > > > the DirectoryServicesPermission and associate your assembly with
similar
> > to
> > > > the thread
> > > >
> >
http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> > > >
> > > > or
> > > >
> > > >
> >
http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> > > >
> > > > In your case, you won't be using FileIOPermission but
> > > > DirectoryServicesPermission
> > > >
> > > > 2. In your assembly before the FindAll call assert the
> > > > DirectoryServicesPermission
> > > >
> > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > Dim dsp As DirectoryServicesPermission
> > > >
> > > > dsp = New
> > > >
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > ps.AddPermission(dsp)
> > > >
> > > > ' Stop security checks at this point in the stack walk for the
specified
> > > > permissions
> > > > ps.Assert()
> > > >
> > > > 3. Reading the documentation on DirectorySearcher, you may need to
add
> > the
> > > > AllowPartiallyTrustedCallers attribute to your custom assembly.
> > > >
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ---
> > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > Home page and blog: http://www.prologika.com/
> > > > ---
> > > >
> > > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in
message
> > > > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > > > I'm having a problem using SQL Server Reporting Services in a
> > deployment
> > > > of a
> > > > > project which makes use of an assembly which reads from an Active
> > > > Directory
> > > > > attribute.
> > > > >
> > > > > I'm trying to read an Active Directory attribute using a class
created
> > in
> > > > > VB.NET, the following is the code used:
> > > > > Public Function GetUserInfo(ByVal inSAM As String, ByVal
inType As
> > > > > String) As String
> > > > > Try
> > > > > Dim sPath As String = "LDAP://Dominio" '' Dominio
donde se
> > > > buscara
> > > > > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> > > > InStr(inSAM,
> > > > > "\")) ''' Usuario que se buscara
> > > > > Dim myDirectory As New DirectoryEntry(sPath,
> > "dominio\user",
> > > > > "password") 'pass the user account and password for your
Enterprise
> > admin.
> > > > > Dim mySearcher As New DirectorySearcher(myDirectory)
> > > > > Dim mySearchResultColl As SearchResultCollection
> > > > > Dim mySearchResult As SearchResult
> > > > > Dim myResultPropColl As ResultPropertyCollection
> > > > > Dim myResultPropValueColl As
ResultPropertyValueCollection
> > > > > 'Build LDAP query
> > > > > mySearcher.Filter =("(&(objectClass=user)(samaccountname="
> > &
> > > > > SamAccount & "))")
> > > > > mySearchResultColl = mySearcher.FindAll()
> > > > > 'I expect only one user from search result
> > > > > Select Case mySearchResultColl.Count
> > > > > Case 0
> > > > > Return "Null"
> > > > > Exit Function
> > > > > Case Is > 1
> > > > > Return "Null"
> > > > > Exit Function
> > > > > End Select
> > > > > 'Get the search result from the collection
> > > > > mySearchResult = mySearchResultColl.Item(0)
> > > > > 'Get the Properites, they contain the usefull info
> > > > > myResultPropColl = mySearchResult.Properties
> > > > > 'displayname, mail
> > > > > 'Retrieve from the properties collection the display
name
> > and
> > > > > email of the user
> > > > > myResultPropValueColl = myResultPropColl.Item(inType)
> > > > > Return CStr(myResultPropValueColl.Item(0))
> > > > > Catch ex As System.Exception
> > > > > 'do some error return here.
> > > > > End Try
> > > > > End Function
> > > > > The class seems work correct in Design View, but when I try to
deply,
> > a
> > > > host
> > > > > assembly security error is displayed. I understand one has to
modify
> > the
> > > > > configuration files of Reporting Services en enable correct
security,
> > > > > (rssrvpolicy.config and rspreviewpolicy.config), I've done this
but am
> > > > seeing
> > > > > the
> > > > > same error. Also, I've copied the dll file of the assembly to the
/bin
> > > > > directory of
> > > > > Reporting Serivices and to the Report Designer directory as
indicated,
> > but
> > > > > still no luck with the error.
> > > > > Permissions seem to be set correcty in the Virtual Directory of
> > Reporting
> > > > > Services.
> > > > > For the Deployment, I've set up the project properties as follows:
> > > > > OverwriteDateSources=True
> > > > > TargetFolder=pruebadll
> > > > > TargetServerURL=http://lopezcarlos/reportserver
> > > > > In the configuration files I've setup in the following manner,
> > apparantely
> > > > > it's not
> > > > > working:
> > > > > <CodeGroup
> > > > > class="UnionCodeGroup"
> > > > > version="1"
> > > > > Unrestricted="true"
> > > > > PermissionSetName="FullTrust"
> > > > > Name="MyCustomAssemblyCodeGroup"
> > > > > Description="Codigo especial para leer el active
> > directory">
> > > > > <IMembershipCondition
> > > > > class="UrlMembershipCondition"
> > > > > version="1"
> > > > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > > > </CodeGroup>
> > > > > In the Property References section of the report, a reference to
> > itself is
> > > > > made,
> > > > > and in the preview of Visual Studio .NET 2003 the reports is
> > visualized
> > > > > correctly.
> > > > > the problem occurs in the deployment process.
> > > > > When deployed, the report displays the following error:
> > > > > Error on loading the host assembly. Details: Security Error
> > > > > (rsProcessingError)
> > > > >
> > > > > The following link has the information I've used to do the design
of
> > the
> > > > > report,:
> > > > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > > > Thanks for the help.
> > > > >
> > > >
> > > >
> > > >
> >
> >
> >|||OK, send me the project to have a look. You can send it to my e-mail address
by removing nospam.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:2F19F79D-5A5B-4971-86F2-5F2B635090C7@.microsoft.com...
> Thanks Teo,
> This imports (System.DirectoryServices), i already ve added to the
project,
> but dont solve my problem, can i send my project files?.
> Thanks.
> "Teo Lachev [MVP]" wrote:
> > Yes, System.DirectoryServices
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> > > Hi Teo.
> > > I try to do that, but i can't write the followin lines of code:
> > >
> > > Dim ps As New PermissionSet(PermissionState.None)
> > > Dim dsp As DirectoryServicesPermission
> > >
> > > dsp = New
> > > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > ps.AddPermission(dsp)
> > > ps.Assert()
> > >
> > > Need import some assembly'
> > >
> > > Thanks.
> > >
> > >
> > > "Teo Lachev [MVP]" wrote:
> > >
> > > > Carlos,
> > > >
> > > > Try this:
> > > >
> > > > 1. In the rssrvpolicy.config, create a new PermissionSet class
> > containing
> > > > the DirectoryServicesPermission and associate your assembly with
similar
> > to
> > > > the thread
> > > >
> >
http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> > > >
> > > > or
> > > >
> > > >
> >
http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> > > >
> > > > In your case, you won't be using FileIOPermission but
> > > > DirectoryServicesPermission
> > > >
> > > > 2. In your assembly before the FindAll call assert the
> > > > DirectoryServicesPermission
> > > >
> > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > Dim dsp As DirectoryServicesPermission
> > > >
> > > > dsp = New
> > > >
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > ps.AddPermission(dsp)
> > > >
> > > > ' Stop security checks at this point in the stack walk for the
specified
> > > > permissions
> > > > ps.Assert()
> > > >
> > > > 3. Reading the documentation on DirectorySearcher, you may need to
add
> > the
> > > > AllowPartiallyTrustedCallers attribute to your custom assembly.
> > > >
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ---
> > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > Home page and blog: http://www.prologika.com/
> > > > ---
> > > >
> > > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in
message
> > > > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > > > I'm having a problem using SQL Server Reporting Services in a
> > deployment
> > > > of a
> > > > > project which makes use of an assembly which reads from an Active
> > > > Directory
> > > > > attribute.
> > > > >
> > > > > I'm trying to read an Active Directory attribute using a class
created
> > in
> > > > > VB.NET, the following is the code used:
> > > > > Public Function GetUserInfo(ByVal inSAM As String, ByVal
inType As
> > > > > String) As String
> > > > > Try
> > > > > Dim sPath As String = "LDAP://Dominio" '' Dominio
donde se
> > > > buscara
> > > > > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> > > > InStr(inSAM,
> > > > > "\")) ''' Usuario que se buscara
> > > > > Dim myDirectory As New DirectoryEntry(sPath,
> > "dominio\user",
> > > > > "password") 'pass the user account and password for your
Enterprise
> > admin.
> > > > > Dim mySearcher As New DirectorySearcher(myDirectory)
> > > > > Dim mySearchResultColl As SearchResultCollection
> > > > > Dim mySearchResult As SearchResult
> > > > > Dim myResultPropColl As ResultPropertyCollection
> > > > > Dim myResultPropValueColl As
ResultPropertyValueCollection
> > > > > 'Build LDAP query
> > > > > mySearcher.Filter =("(&(objectClass=user)(samaccountname="
> > &
> > > > > SamAccount & "))")
> > > > > mySearchResultColl = mySearcher.FindAll()
> > > > > 'I expect only one user from search result
> > > > > Select Case mySearchResultColl.Count
> > > > > Case 0
> > > > > Return "Null"
> > > > > Exit Function
> > > > > Case Is > 1
> > > > > Return "Null"
> > > > > Exit Function
> > > > > End Select
> > > > > 'Get the search result from the collection
> > > > > mySearchResult = mySearchResultColl.Item(0)
> > > > > 'Get the Properites, they contain the usefull info
> > > > > myResultPropColl = mySearchResult.Properties
> > > > > 'displayname, mail
> > > > > 'Retrieve from the properties collection the display
name
> > and
> > > > > email of the user
> > > > > myResultPropValueColl = myResultPropColl.Item(inType)
> > > > > Return CStr(myResultPropValueColl.Item(0))
> > > > > Catch ex As System.Exception
> > > > > 'do some error return here.
> > > > > End Try
> > > > > End Function
> > > > > The class seems work correct in Design View, but when I try to
deply,
> > a
> > > > host
> > > > > assembly security error is displayed. I understand one has to
modify
> > the
> > > > > configuration files of Reporting Services en enable correct
security,
> > > > > (rssrvpolicy.config and rspreviewpolicy.config), I've done this
but am
> > > > seeing
> > > > > the
> > > > > same error. Also, I've copied the dll file of the assembly to the
/bin
> > > > > directory of
> > > > > Reporting Serivices and to the Report Designer directory as
indicated,
> > but
> > > > > still no luck with the error.
> > > > > Permissions seem to be set correcty in the Virtual Directory of
> > Reporting
> > > > > Services.
> > > > > For the Deployment, I've set up the project properties as follows:
> > > > > OverwriteDateSources=True
> > > > > TargetFolder=pruebadll
> > > > > TargetServerURL=http://lopezcarlos/reportserver
> > > > > In the configuration files I've setup in the following manner,
> > apparantely
> > > > > it's not
> > > > > working:
> > > > > <CodeGroup
> > > > > class="UnionCodeGroup"
> > > > > version="1"
> > > > > Unrestricted="true"
> > > > > PermissionSetName="FullTrust"
> > > > > Name="MyCustomAssemblyCodeGroup"
> > > > > Description="Codigo especial para leer el active
> > directory">
> > > > > <IMembershipCondition
> > > > > class="UrlMembershipCondition"
> > > > > version="1"
> > > > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > > > </CodeGroup>
> > > > > In the Property References section of the report, a reference to
> > itself is
> > > > > made,
> > > > > and in the preview of Visual Studio .NET 2003 the reports is
> > visualized
> > > > > correctly.
> > > > > the problem occurs in the deployment process.
> > > > > When deployed, the report displays the following error:
> > > > > Error on loading the host assembly. Details: Security Error
> > > > > (rsProcessingError)
> > > > >
> > > > > The following link has the information I've used to do the design
of
> > the
> > > > > report,:
> > > > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > > > Thanks for the help.
> > > > >
> > > >
> > > >
> > > >
> >
> >
> >|||Hi Teo.
Tanks by your attention!
I Have another problem, i try to access an oracle database from a custom
assembly, in desing view all work nice, but in prodction environment, the
call to tha class fall!.
What i can do to correct this problem?
Thanks!
"Teo Lachev [MVP]" wrote:
> OK, send me the project to have a look. You can send it to my e-mail address
> by removing nospam.
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> news:2F19F79D-5A5B-4971-86F2-5F2B635090C7@.microsoft.com...
> > Thanks Teo,
> > This imports (System.DirectoryServices), i already ve added to the
> project,
> > but dont solve my problem, can i send my project files?.
> >
> > Thanks.
> >
> > "Teo Lachev [MVP]" wrote:
> >
> > > Yes, System.DirectoryServices
> > >
> > > --
> > > Hope this helps.
> > >
> > > ---
> > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > Home page and blog: http://www.prologika.com/
> > > ---
> > >
> > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > > news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> > > > Hi Teo.
> > > > I try to do that, but i can't write the followin lines of code:
> > > >
> > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > Dim dsp As DirectoryServicesPermission
> > > >
> > > > dsp = New
> > > > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > ps.AddPermission(dsp)
> > > > ps.Assert()
> > > >
> > > > Need import some assembly'
> > > >
> > > > Thanks.
> > > >
> > > >
> > > > "Teo Lachev [MVP]" wrote:
> > > >
> > > > > Carlos,
> > > > >
> > > > > Try this:
> > > > >
> > > > > 1. In the rssrvpolicy.config, create a new PermissionSet class
> > > containing
> > > > > the DirectoryServicesPermission and associate your assembly with
> similar
> > > to
> > > > > the thread
> > > > >
> > >
> http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> > > > >
> > > > > or
> > > > >
> > > > >
> > >
> http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> > > > >
> > > > > In your case, you won't be using FileIOPermission but
> > > > > DirectoryServicesPermission
> > > > >
> > > > > 2. In your assembly before the FindAll call assert the
> > > > > DirectoryServicesPermission
> > > > >
> > > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > > Dim dsp As DirectoryServicesPermission
> > > > >
> > > > > dsp = New
> > > > >
> DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > > ps.AddPermission(dsp)
> > > > >
> > > > > ' Stop security checks at this point in the stack walk for the
> specified
> > > > > permissions
> > > > > ps.Assert()
> > > > >
> > > > > 3. Reading the documentation on DirectorySearcher, you may need to
> add
> > > the
> > > > > AllowPartiallyTrustedCallers attribute to your custom assembly.
> > > > >
> > > > >
> > > > > --
> > > > > Hope this helps.
> > > > >
> > > > > ---
> > > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > > Author: "Microsoft Reporting Services in Action"
> > > > > Publisher website: http://www.manning.com/lachev
> > > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > > Home page and blog: http://www.prologika.com/
> > > > > ---
> > > > >
> > > > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in
> message
> > > > > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > > > > I'm having a problem using SQL Server Reporting Services in a
> > > deployment
> > > > > of a
> > > > > > project which makes use of an assembly which reads from an Active
> > > > > Directory
> > > > > > attribute.
> > > > > >
> > > > > > I'm trying to read an Active Directory attribute using a class
> created
> > > in
> > > > > > VB.NET, the following is the code used:
> > > > > > Public Function GetUserInfo(ByVal inSAM As String, ByVal
> inType As
> > > > > > String) As String
> > > > > > Try
> > > > > > Dim sPath As String = "LDAP://Dominio" '' Dominio
> donde se
> > > > > buscara
> > > > > > Dim SamAccount As String = Right(inSAM, Len(inSAM) -
> > > > > InStr(inSAM,
> > > > > > "\")) ''' Usuario que se buscara
> > > > > > Dim myDirectory As New DirectoryEntry(sPath,
> > > "dominio\user",
> > > > > > "password") 'pass the user account and password for your
> Enterprise
> > > admin.
> > > > > > Dim mySearcher As New DirectorySearcher(myDirectory)
> > > > > > Dim mySearchResultColl As SearchResultCollection
> > > > > > Dim mySearchResult As SearchResult
> > > > > > Dim myResultPropColl As ResultPropertyCollection
> > > > > > Dim myResultPropValueColl As
> ResultPropertyValueCollection
> > > > > > 'Build LDAP query
> > > > > > mySearcher.Filter => ("(&(objectClass=user)(samaccountname="
> > > &
> > > > > > SamAccount & "))")
> > > > > > mySearchResultColl = mySearcher.FindAll()
> > > > > > 'I expect only one user from search result
> > > > > > Select Case mySearchResultColl.Count
> > > > > > Case 0
> > > > > > Return "Null"
> > > > > > Exit Function
> > > > > > Case Is > 1
> > > > > > Return "Null"
> > > > > > Exit Function
> > > > > > End Select
> > > > > > 'Get the search result from the collection
> > > > > > mySearchResult = mySearchResultColl.Item(0)
> > > > > > 'Get the Properites, they contain the usefull info
> > > > > > myResultPropColl = mySearchResult.Properties
> > > > > > 'displayname, mail
> > > > > > 'Retrieve from the properties collection the display
> name
> > > and
> > > > > > email of the user
> > > > > > myResultPropValueColl = myResultPropColl.Item(inType)
> > > > > > Return CStr(myResultPropValueColl.Item(0))
> > > > > > Catch ex As System.Exception
> > > > > > 'do some error return here.
> > > > > > End Try
> > > > > > End Function
> > > > > > The class seems work correct in Design View, but when I try to
> deply,
> > > a
> > > > > host
> > > > > > assembly security error is displayed. I understand one has to
> modify
> > > the
> > > > > > configuration files of Reporting Services en enable correct
> security,
> > > > > > (rssrvpolicy.config and rspreviewpolicy.config), I've done this
> but am
> > > > > seeing
> > > > > > the
> > > > > > same error. Also, I've copied the dll file of the assembly to the
> /bin
> > > > > > directory of
> > > > > > Reporting Serivices and to the Report Designer directory as
> indicated,
> > > but
> > > > > > still no luck with the error.
> > > > > > Permissions seem to be set correcty in the Virtual Directory of
> > > Reporting
> > > > > > Services.
> > > > > > For the Deployment, I've set up the project properties as follows:
> > > > > > OverwriteDateSources=True
> > > > > > TargetFolder=pruebadll
> > > > > > TargetServerURL=http://lopezcarlos/reportserver
> > > > > > In the configuration files I've setup in the following manner,
> > > apparantely
> > > > > > it's not
> > > > > > working:
> > > > > > <CodeGroup
> > > > > > class="UnionCodeGroup"
> > > > > > version="1"
> > > > > > Unrestricted="true"
> > > > > > PermissionSetName="FullTrust"
> > > > > > Name="MyCustomAssemblyCodeGroup"
> > > > > > Description="Codigo especial para leer el active
> > > directory">
> > > > > > <IMembershipCondition
> > > > > > class="UrlMembershipCondition"
> > > > > > version="1"
> > > > > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > > > > </CodeGroup>
> > > > > > In the Property References section of the report, a reference to
> > > itself is
> > > > > > made,
> > > > > > and in the preview of Visual Studio .NET 2003 the reports is
> > > visualized
> > > > > > correctly.
> > > > > > the problem occurs in the deployment process.
> > > > > > When deployed, the report displays the following error:
> > > > > > Error on loading the host assembly. Details: Security Error
> > > > > > (rsProcessingError)
> > > > > >
> > > > > > The following link has the information I've used to do the design
> of
> > > the
> > > > > > report,:
> > > > > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > > > > Thanks for the help.
> > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>|||Carlos,
Please review the following thread:
http://groups.google.com/groups?hl=en&lr=&threadm=%23ppSwoScEHA.4092%40TK2MSFTNGP10.phx.gbl&rnum=1&prev=/groups%3Fas_q%3Doracle%2520assembly%26safe%3Dimages%26as_ugroup%3D*.reportingsvcs%26lr%3D%26hl%3Den
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:01FBDA93-AA78-43BD-A589-19A71BE83AE3@.microsoft.com...
> Hi Teo.
> Tanks by your attention!
> I Have another problem, i try to access an oracle database from a custom
> assembly, in desing view all work nice, but in prodction environment, the
> call to tha class fall!.
> What i can do to correct this problem?
> Thanks!
> "Teo Lachev [MVP]" wrote:
> > OK, send me the project to have a look. You can send it to my e-mail
address
> > by removing nospam.
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ---
> >
> > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> > news:2F19F79D-5A5B-4971-86F2-5F2B635090C7@.microsoft.com...
> > > Thanks Teo,
> > > This imports (System.DirectoryServices), i already ve added to the
> > project,
> > > but dont solve my problem, can i send my project files?.
> > >
> > > Thanks.
> > >
> > > "Teo Lachev [MVP]" wrote:
> > >
> > > > Yes, System.DirectoryServices
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ---
> > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > Home page and blog: http://www.prologika.com/
> > > > ---
> > > >
> > > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in
message
> > > > news:BDC8FE37-69C2-4F7C-9437-2660C511A016@.microsoft.com...
> > > > > Hi Teo.
> > > > > I try to do that, but i can't write the followin lines of code:
> > > > >
> > > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > > Dim dsp As DirectoryServicesPermission
> > > > >
> > > > > dsp = New
> > > > >
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > > ps.AddPermission(dsp)
> > > > > ps.Assert()
> > > > >
> > > > > Need import some assembly'
> > > > >
> > > > > Thanks.
> > > > >
> > > > >
> > > > > "Teo Lachev [MVP]" wrote:
> > > > >
> > > > > > Carlos,
> > > > > >
> > > > > > Try this:
> > > > > >
> > > > > > 1. In the rssrvpolicy.config, create a new PermissionSet class
> > > > containing
> > > > > > the DirectoryServicesPermission and associate your assembly with
> > similar
> > > > to
> > > > > > the thread
> > > > > >
> > > >
> >
http://groups.google.com/groups?q=assert+group:*.reportingsvcs+author:teo&hl=en&lr=&selm=ez9iQJqSEHA.1472%40TK2MSFTNGP09.phx.gbl&rnum=1
> > > > > >
> > > > > > or
> > > > > >
> > > > > >
> > > >
> >
http://groups.google.com/groups?hl=en&lr=&threadm=OQe%24dsjhEHA.140%40TK2MSFTNGP12.phx.gbl&rnum=3&prev=/groups%3Fq%3Dpermissionset%2Bassert%2Bgroup:*.reportingsvcs%26hl%3Den%26lr%3D%26selm%3DOQe%2524dsjhEHA.140%2540TK2MSFTNGP12.phx.gbl%26rnum%3D3
> > > > > >
> > > > > > In your case, you won't be using FileIOPermission but
> > > > > > DirectoryServicesPermission
> > > > > >
> > > > > > 2. In your assembly before the FindAll call assert the
> > > > > > DirectoryServicesPermission
> > > > > >
> > > > > > Dim ps As New PermissionSet(PermissionState.None)
> > > > > > Dim dsp As DirectoryServicesPermission
> > > > > >
> > > > > > dsp = New
> > > > > >
> > DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse)
> > > > > > ps.AddPermission(dsp)
> > > > > >
> > > > > > ' Stop security checks at this point in the stack walk for the
> > specified
> > > > > > permissions
> > > > > > ps.Assert()
> > > > > >
> > > > > > 3. Reading the documentation on DirectorySearcher, you may need
to
> > add
> > > > the
> > > > > > AllowPartiallyTrustedCallers attribute to your custom assembly.
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Hope this helps.
> > > > > >
> > > > > > ---
> > > > > > Teo Lachev, MVP [SQL Server], MCSD, MCT
> > > > > > Author: "Microsoft Reporting Services in Action"
> > > > > > Publisher website: http://www.manning.com/lachev
> > > > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > > > Home page and blog: http://www.prologika.com/
> > > > > > ---
> > > > > >
> > > > > > "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in
> > message
> > > > > > news:88509EE6-E92E-4D87-80D7-8F12AE945E13@.microsoft.com...
> > > > > > > I'm having a problem using SQL Server Reporting Services in a
> > > > deployment
> > > > > > of a
> > > > > > > project which makes use of an assembly which reads from an
Active
> > > > > > Directory
> > > > > > > attribute.
> > > > > > >
> > > > > > > I'm trying to read an Active Directory attribute using a class
> > created
> > > > in
> > > > > > > VB.NET, the following is the code used:
> > > > > > > Public Function GetUserInfo(ByVal inSAM As String, ByVal
> > inType As
> > > > > > > String) As String
> > > > > > > Try
> > > > > > > Dim sPath As String = "LDAP://Dominio" '' Dominio
> > donde se
> > > > > > buscara
> > > > > > > Dim SamAccount As String = Right(inSAM,
Len(inSAM) -
> > > > > > InStr(inSAM,
> > > > > > > "\")) ''' Usuario que se buscara
> > > > > > > Dim myDirectory As New DirectoryEntry(sPath,
> > > > "dominio\user",
> > > > > > > "password") 'pass the user account and password for your
> > Enterprise
> > > > admin.
> > > > > > > Dim mySearcher As New
DirectorySearcher(myDirectory)
> > > > > > > Dim mySearchResultColl As SearchResultCollection
> > > > > > > Dim mySearchResult As SearchResult
> > > > > > > Dim myResultPropColl As ResultPropertyCollection
> > > > > > > Dim myResultPropValueColl As
> > ResultPropertyValueCollection
> > > > > > > 'Build LDAP query
> > > > > > > mySearcher.Filter => > ("(&(objectClass=user)(samaccountname="
> > > > &
> > > > > > > SamAccount & "))")
> > > > > > > mySearchResultColl = mySearcher.FindAll()
> > > > > > > 'I expect only one user from search result
> > > > > > > Select Case mySearchResultColl.Count
> > > > > > > Case 0
> > > > > > > Return "Null"
> > > > > > > Exit Function
> > > > > > > Case Is > 1
> > > > > > > Return "Null"
> > > > > > > Exit Function
> > > > > > > End Select
> > > > > > > 'Get the search result from the collection
> > > > > > > mySearchResult = mySearchResultColl.Item(0)
> > > > > > > 'Get the Properites, they contain the usefull info
> > > > > > > myResultPropColl = mySearchResult.Properties
> > > > > > > 'displayname, mail
> > > > > > > 'Retrieve from the properties collection the
display
> > name
> > > > and
> > > > > > > email of the user
> > > > > > > myResultPropValueColl =myResultPropColl.Item(inType)
> > > > > > > Return CStr(myResultPropValueColl.Item(0))
> > > > > > > Catch ex As System.Exception
> > > > > > > 'do some error return here.
> > > > > > > End Try
> > > > > > > End Function
> > > > > > > The class seems work correct in Design View, but when I try to
> > deply,
> > > > a
> > > > > > host
> > > > > > > assembly security error is displayed. I understand one has to
> > modify
> > > > the
> > > > > > > configuration files of Reporting Services en enable correct
> > security,
> > > > > > > (rssrvpolicy.config and rspreviewpolicy.config), I've done
this
> > but am
> > > > > > seeing
> > > > > > > the
> > > > > > > same error. Also, I've copied the dll file of the assembly to
the
> > /bin
> > > > > > > directory of
> > > > > > > Reporting Serivices and to the Report Designer directory as
> > indicated,
> > > > but
> > > > > > > still no luck with the error.
> > > > > > > Permissions seem to be set correcty in the Virtual Directory
of
> > > > Reporting
> > > > > > > Services.
> > > > > > > For the Deployment, I've set up the project properties as
follows:
> > > > > > > OverwriteDateSources=True
> > > > > > > TargetFolder=pruebadll
> > > > > > > TargetServerURL=http://lopezcarlos/reportserver
> > > > > > > In the configuration files I've setup in the following manner,
> > > > apparantely
> > > > > > > it's not
> > > > > > > working:
> > > > > > > <CodeGroup
> > > > > > > class="UnionCodeGroup"
> > > > > > > version="1"
> > > > > > > Unrestricted="true"
> > > > > > > PermissionSetName="FullTrust"
> > > > > > > Name="MyCustomAssemblyCodeGroup"
> > > > > > > Description="Codigo especial para leer el active
> > > > directory">
> > > > > > > <IMembershipCondition
> > > > > > > class="UrlMembershipCondition"
> > > > > > > version="1"
> > > > > > > Url="E:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > > > > Services\ReportServer\bin\MyCustomAssembly.dll" />
> > > > > > > </CodeGroup>
> > > > > > > In the Property References section of the report, a reference
to
> > > > itself is
> > > > > > > made,
> > > > > > > and in the preview of Visual Studio .NET 2003 the reports is
> > > > visualized
> > > > > > > correctly.
> > > > > > > the problem occurs in the deployment process.
> > > > > > > When deployed, the report displays the following error:
> > > > > > > Error on loading the host assembly. Details: Security Error
> > > > > > > (rsProcessingError)
> > > > > > >
> > > > > > > The following link has the information I've used to do the
design
> > of
> > > > the
> > > > > > > report,:
> > > > > > > http://blogs.sqlxml.org/bryantlikes/articles/824.aspx
> > > > > > > Thanks for the help.
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >