I try to get a custom assembly running with Reporting Services on Windows
Server 2003. The assembly must access a SQL Server database on the same SQL
Server as Reporting Services (localhost)
The assembly is written with VB .NET 2003. I have a assembly running
accessing a oracle db, this assembly works. So I know the security settings
etc. But the problem must be somewhere in detail. Therefore detailed answers
are appreciated.
The assembly works in the designer but not in Report Server on Windows
Server 2003. The assembly get accessed by the report server but obviously the
database connection failed.
Content bellow:
- rsvPolicy.config settings
- Code in assembly
- Additional information
Settings in the rsvPolicy.config:
<PermissionSet class="NamedPermissionSet"
version="1"
Name="MyNewFilePermissionSet"
Description="A special permission set that grants read access to my file.">
<IPermission class="System.Data.OleDb.OleDbPermission"
version="1"
Flags="Assertion, Execution"/>
</PermissionSet>
<PermissionSet class="NamedPermissionSet"
version="1"
Name="MyNewFilePermissionSet"
Description="A special permission set that grants read access to my file.">
<IPermission class="System.Security.PermissionSet"
version="1"
Flags="Assertion, Execution"/>
</PermissionSet>
Code in the assembly
' declaration of the security object in the header of the class
Private m_objSecurity As System.Security.PermissionSet
Private m_strConnString As String = _
"Provider=SQLOLEDB;Data Source=localhost;Initial
Catalog=MyDatabase;Integrated Security=SSPI;"
' function to open the db
<PermissionSet(SecurityAction.Assert, Unrestricted:=True)> _
Public Function OpenDBConn() As Boolean
m_objSecurity = New PermissionSet(PermissionState.Unrestricted)
m_objSecurity.Assert()
m_objDBConn = New
System.Data.OleDB.OleDbConnection(m_strConnString)
m_objDBConn.Open()
If m_objDBConn.State = ConnectionState.Open Then
InitSQLSRVConn = True
End IF
Addional information:
IDE: .net 2003
SQL Server 2000 SP3a
Windows Server 2003
Reporting Services Enterprise Edition + SP 2The assembly works on a Windows 2000 (SP4) Machine.
For this reason I assume that the problem is related to Windows 2003 Server,
or with SP2 from Reporting Services in relation with Windows 2003 Server.
Just for the sake of completnes bellowe the code meanwhile tried on both
Systems (W2K and W2K3 Srv)
--
In rssrvpoliciy.config:
--
<PermissionSet class="NamedPermissionSet"
version="1"
Name="MyNewFilePermissionSet"
Description="A special permission set that grants access to SQL Server
Database.">
<IPermission class="System.Data.OleDB.OleDbPermission"
version="1"
Flags="Assertion, Execution"/>
</PermissionSet>
'--
' In the Assembly
'--
Private m_objSecurity As System.Data.OleDB.OleDbPermission
Private m_strConnString As String = _
"Provider=SQLOLEDB;Data Source=localhost;Initial
Catalog=myDatabase;Integrated Security=SSPI;"
<PermissionSet(SecurityAction.Assert, Unrestricted:=True)> _
Public Function InitSQLSRVConn() As Boolean
m_objSecurity = New
System.Data.OleDb.OleDbPermission(PermissionState.Unrestricted)
m_objSecurity.Assert()
m_objDBConn = New
System.Data.OleDB.OleDbConnection(m_strConnString)
m_objDBConn.Open()
If m_objDBConn.State = ConnectionState.Open Then
InitSQLSRVConn = True
End if
"Dev Main" wrote:
> I try to get a custom assembly running with Reporting Services on Windows
> Server 2003. The assembly must access a SQL Server database on the same SQL
> Server as Reporting Services (localhost)
> The assembly is written with VB .NET 2003. I have a assembly running
> accessing a oracle db, this assembly works. So I know the security settings
> etc. But the problem must be somewhere in detail. Therefore detailed answers
> are appreciated.
> The assembly works in the designer but not in Report Server on Windows
> Server 2003. The assembly get accessed by the report server but obviously the
> database connection failed.
> Content bellow:
> - rsvPolicy.config settings
> - Code in assembly
> - Additional information
> Settings in the rsvPolicy.config:
> <PermissionSet class="NamedPermissionSet"
> version="1"
> Name="MyNewFilePermissionSet"
> Description="A special permission set that grants read access to my file.">
> <IPermission class="System.Data.OleDb.OleDbPermission"
> version="1"
> Flags="Assertion, Execution"/>
> </PermissionSet>
> <PermissionSet class="NamedPermissionSet"
> version="1"
> Name="MyNewFilePermissionSet"
> Description="A special permission set that grants read access to my file.">
> <IPermission class="System.Security.PermissionSet"
> version="1"
> Flags="Assertion, Execution"/>
> </PermissionSet>
>
> Code in the assembly
> ' declaration of the security object in the header of the class
> Private m_objSecurity As System.Security.PermissionSet
> Private m_strConnString As String = _
> "Provider=SQLOLEDB;Data Source=localhost;Initial
> Catalog=MyDatabase;Integrated Security=SSPI;"
> ' function to open the db
> <PermissionSet(SecurityAction.Assert, Unrestricted:=True)> _
> Public Function OpenDBConn() As Boolean
> m_objSecurity = New PermissionSet(PermissionState.Unrestricted)
> m_objSecurity.Assert()
> m_objDBConn = New
> System.Data.OleDB.OleDbConnection(m_strConnString)
> m_objDBConn.Open()
> If m_objDBConn.State = ConnectionState.Open Then
> InitSQLSRVConn = True
> End IF
>
> Addional information:
> IDE: .net 2003
> SQL Server 2000 SP3a
> Windows Server 2003
> Reporting Services Enterprise Edition + SP 2
>
>|||At least the version in my second post works correct. The reason for the
failure was a other mistake not related to reporting services at all.
"Dev Main" wrote:
> I try to get a custom assembly running with Reporting Services on Windows
> Server 2003. The assembly must access a SQL Server database on the same SQL
> Server as Reporting Services (localhost)
> The assembly is written with VB .NET 2003. I have a assembly running
> accessing a oracle db, this assembly works. So I know the security settings
> etc. But the problem must be somewhere in detail. Therefore detailed answers
> are appreciated.
> The assembly works in the designer but not in Report Server on Windows
> Server 2003. The assembly get accessed by the report server but obviously the
> database connection failed.
> Content bellow:
> - rsvPolicy.config settings
> - Code in assembly
> - Additional information
> Settings in the rsvPolicy.config:
> <PermissionSet class="NamedPermissionSet"
> version="1"
> Name="MyNewFilePermissionSet"
> Description="A special permission set that grants read access to my file.">
> <IPermission class="System.Data.OleDb.OleDbPermission"
> version="1"
> Flags="Assertion, Execution"/>
> </PermissionSet>
> <PermissionSet class="NamedPermissionSet"
> version="1"
> Name="MyNewFilePermissionSet"
> Description="A special permission set that grants read access to my file.">
> <IPermission class="System.Security.PermissionSet"
> version="1"
> Flags="Assertion, Execution"/>
> </PermissionSet>
>
> Code in the assembly
> ' declaration of the security object in the header of the class
> Private m_objSecurity As System.Security.PermissionSet
> Private m_strConnString As String = _
> "Provider=SQLOLEDB;Data Source=localhost;Initial
> Catalog=MyDatabase;Integrated Security=SSPI;"
> ' function to open the db
> <PermissionSet(SecurityAction.Assert, Unrestricted:=True)> _
> Public Function OpenDBConn() As Boolean
> m_objSecurity = New PermissionSet(PermissionState.Unrestricted)
> m_objSecurity.Assert()
> m_objDBConn = New
> System.Data.OleDB.OleDbConnection(m_strConnString)
> m_objDBConn.Open()
> If m_objDBConn.State = ConnectionState.Open Then
> InitSQLSRVConn = True
> End IF
>
> Addional information:
> IDE: .net 2003
> SQL Server 2000 SP3a
> Windows Server 2003
> Reporting Services Enterprise Edition + SP 2
>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment