Have a small problem. I have written a custom assembly to query a db2
database through a dsn datasource. It works fine in Report Designer but
shows the #error message in the fields on the report once it is published.
Following is my rssrvpolicy.config entry:
<CodeGroup
class="UnionCodeGroup"
version="1.0.0.0"
PermissionSetName="FullTrust"
Name="DB2Link"
Description="This assembly connects to the DB2 database server and
retrieves information">
<IMembershipCondition
class="UrlMembershipCondition"
version="1.0.0.0"
Url="C:\Program Files\Microsoft SQL
Server\MSSQL\Reporting Services\ReportServer\bin\DB2Link.dll"
/>
</CodeGroup>
I have also added the following code to my Class Library prior to compiling
and deploying:
Dim Permission As New
Odbc.OdbcPermission(Security.Permissions.PermissionState.Unrestricted)
Permission.Assert()
but to no avail. Any help would be greatly appreciated. BTW, the ODBC
connection information is all housed within the library. It takes a string
value passed from SRS and returns a single string value. Nothing fancy...
Do I need to create an access group to the DSN File?
Thanks,Asserting the ODBC Permission might not be sufficient. You may want to try
asserting full trust in the custom assembly:
[PermissionSet(SecurityAction.Assert, Unrestricted=true)]
public foo()
{
// Your code:
// open database connection
// ...
}
See also this thread related to connecting to Oracle from a custom assembly:
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.sqlserver.reportingsvcs&mid=3cd1a1de-15d4-41fe-bc9b-3c9df93ac2ee&sloc=en-us
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"JamesH" <JamesH@.discussions.microsoft.com> wrote in message
news:84982C3D-32DD-4D3B-B46C-2766810046F0@.microsoft.com...
> Have a small problem. I have written a custom assembly to query a db2
> database through a dsn datasource. It works fine in Report Designer but
> shows the #error message in the fields on the report once it is published.
> Following is my rssrvpolicy.config entry:
> <CodeGroup
> class="UnionCodeGroup"
> version="1.0.0.0"
> PermissionSetName="FullTrust"
> Name="DB2Link"
> Description="This assembly connects to the DB2 database server and
> retrieves information">
> <IMembershipCondition
> class="UrlMembershipCondition"
> version="1.0.0.0"
> Url="C:\Program Files\Microsoft SQL
> Server\MSSQL\Reporting Services\ReportServer\bin\DB2Link.dll"
> />
> </CodeGroup>
> I have also added the following code to my Class Library prior to
compiling
> and deploying:
> Dim Permission As New
> Odbc.OdbcPermission(Security.Permissions.PermissionState.Unrestricted)
> Permission.Assert()
> but to no avail. Any help would be greatly appreciated. BTW, the ODBC
> connection information is all housed within the library. It takes a
string
> value passed from SRS and returns a single string value. Nothing fancy...
> Do I need to create an access group to the DSN File?
> Thanks,|||Thanks, I will look at it, I left the code on another computer and won't be
able to try it until tomorrow, will let you know.
"JamesH" wrote:
> Have a small problem. I have written a custom assembly to query a db2
> database through a dsn datasource. It works fine in Report Designer but
> shows the #error message in the fields on the report once it is published.
> Following is my rssrvpolicy.config entry:
> <CodeGroup
> class="UnionCodeGroup"
> version="1.0.0.0"
> PermissionSetName="FullTrust"
> Name="DB2Link"
> Description="This assembly connects to the DB2 database server and
> retrieves information">
> <IMembershipCondition
> class="UrlMembershipCondition"
> version="1.0.0.0"
> Url="C:\Program Files\Microsoft SQL
> Server\MSSQL\Reporting Services\ReportServer\bin\DB2Link.dll"
> />
> </CodeGroup>
> I have also added the following code to my Class Library prior to compiling
> and deploying:
> Dim Permission As New
> Odbc.OdbcPermission(Security.Permissions.PermissionState.Unrestricted)
> Permission.Assert()
> but to no avail. Any help would be greatly appreciated. BTW, the ODBC
> connection information is all housed within the library. It takes a string
> value passed from SRS and returns a single string value. Nothing fancy...
> Do I need to create an access group to the DSN File?
> Thanks,|||Robert, I've tried about everything I can think of: I even tried a sample
that has worked for others using an assembly to read a text file but to no
avail. Sorry for all of the code below but I'm at a loss. I've also set the
version to be 1.0.0.0.0 in my assembly and added the : <Assembly:
AllowPartiallyTrustedCallers()> although I haven't setup strong naming. If
you see anything that I've messed up, please let me know...I'm stumped.
This is my Class Code:
Imports System.IO
Imports System.Security.Permissions
Public Class ReadResultsFile
<FileIOPermissionAttribute(SecurityAction.Assert,
Read:="C:\JHHTST2.txt")> _
Public Shared Function GetResults() As String
Dim reader As StreamReader = New StreamReader("c:\JHHTST2.txt")
Dim hello As String = reader.ReadToEnd()
reader.Close()
Return hello
End Function
End Class
This as the PermissionSet Code:
<PermissionSet
class="NamedPermissionSet"
version="1"
Name="ReadObjectFilePermissionSet"
Description="A special permission set that grants read access to my hello
file.">
<IPermission
class="FileIOPermission"
version="1"
Read="C:\JHHTST2.txt"
/>
<IPermission
class="SecurityPermission"
version="1"
Flags="Execution, Assertion"
/>
</PermissionSet>
This is my Codegroup:
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="ReadObjectFilePermissionSet"
Name="ReadScriptFile"
Description="A special code group for my custom assembly.">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\ReadScriptFile.dll"
/>
</CodeGroup>
Thanks,
JamesH.|||Make sure the the CodeGroup section you added is right below the
Report_Expressions_Default_Permissions CodeGroup. Position in the file
does have an effect.
--
Thanks.
Donovan R. Smith
Software Test Lead
This posting is provided "AS IS" with no warranties, and confers no rights.|||I added it in there, no change.
JamesH.
"Donovan R. Smith [MS]" wrote:
> Make sure the the CodeGroup section you added is right below the
> Report_Expressions_Default_Permissions CodeGroup. Position in the file
> does have an effect.
> --
> Thanks.
> Donovan R. Smith
> Software Test Lead
> This posting is provided "AS IS" with no warranties, and confers no rights.
>|||Never Mind, got it working today by adding a linked server to SQL and then
using the SQLClient connection in the assembly, worked like a champ... Is
there anybody that has used ODBC with Custom assemblies?
JamesH.
"JamesH" wrote:
> This weekend I rebuilt everything at least 10 times and then built a virtual
> pc image and reloaded everything to no avail. I've added Strong_name to the
> .dlls and still no luck. I'm not seeing any errors in the logs at all, just
> the #error message on my report screen. I've tried deleting the reports,
> re-adding the custom assembly each time and then re-deploying along with
> re-copying the .dll. I even tried to get it to work with another .dll that
> still doesn't work. Any help now would be greatly appreciated on just
> getting a single custom assembly working. Are there any walk-throughs
> (cradle to grave) at all by MS?
> THanks,
> "JamesH" wrote:
> > I added it in there, no change.
> >
> > JamesH.
> >
> > "Donovan R. Smith [MS]" wrote:
> >
> > > Make sure the the CodeGroup section you added is right below the
> > > Report_Expressions_Default_Permissions CodeGroup. Position in the file
> > > does have an effect.
> > >
> > > --
> > > Thanks.
> > >
> > > Donovan R. Smith
> > > Software Test Lead
> > >
> > > This posting is provided "AS IS" with no warranties, and confers no rights.
> > >sql
Showing posts with label written. Show all posts
Showing posts with label written. Show all posts
Tuesday, March 27, 2012
DB2 & SQL server?
Hi Folks,
We have a DB2 database on a WAN at work. I want to access the database from
some Visual Basic for Applications code that I have written at work.
The database itself is not directly accessable and as it was described to me
is "buffered"
from the users by a second computer which passes on requests for data.
I assume that this intermediary computer would be whats called a SQL server?
If my assumption above is correct is it possible to get a query to the
server which
it will accept and reply to?
Anyone?
Cheers
-AlYou need to ask whoever is administering your servers what technology is
used for accessing the DB2 database. Microsoft has a product called Host
Integration Server which can connect to DB2 systems. It is also possible to
link Microsoft SQLServer to external data sources such as DB2, but without
more information about what system you have in place it's difficult to give
a useful answer to your question.
Assuming you are provided with an OLEDB or ODBC connection to the database
you can use ADO to access your data from within Visual Basic.
http://msdn.microsoft.com/library/d.../>
rtpage1.asp
http://msdn.microsoft.com/library/d...t_oledb-db2.asp
To do this you'll need information such as the provider name, server name,
database name, user name and password. Your system administrator should be
able to supply that information.
(cross-postings removed)
David Portas
--
Please reply only to the newsgroup
--|||Thanks for the reply.
Currently we can query the database via a webpage interface.
I have looked at the code behind the webpage and it consists of some
javascript.
I am guessing but it looks like the webpage sends the request to the
webserver
which I assume passes it to the SQL server.
Is it possible that the computer i work on cant talk to the sql server
directly?
I need to know where to go from here...
Cheers
-Al
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:ereU30F0DHA.2308@.TK2MSFTNGP11.phx.gbl...
to
give
http://msdn.microsoft.com/library/d...ostartpage1.asp[QUOT
E]
>[/QUOTE]
http://msdn.microsoft.com/library/d...t_oledb-db2.asp[
QUOTE]
> To do this you'll need information such as the provider name, server name,
> database name, user name and password. Your system administrator should be
> able to supply that information.
>
> (cross-postings removed)
> --
> David Portas
> --
> Please reply only to the newsgroup
> --
>[/QUOTE]
We have a DB2 database on a WAN at work. I want to access the database from
some Visual Basic for Applications code that I have written at work.
The database itself is not directly accessable and as it was described to me
is "buffered"
from the users by a second computer which passes on requests for data.
I assume that this intermediary computer would be whats called a SQL server?
If my assumption above is correct is it possible to get a query to the
server which
it will accept and reply to?
Anyone?
Cheers
-AlYou need to ask whoever is administering your servers what technology is
used for accessing the DB2 database. Microsoft has a product called Host
Integration Server which can connect to DB2 systems. It is also possible to
link Microsoft SQLServer to external data sources such as DB2, but without
more information about what system you have in place it's difficult to give
a useful answer to your question.
Assuming you are provided with an OLEDB or ODBC connection to the database
you can use ADO to access your data from within Visual Basic.
http://msdn.microsoft.com/library/d.../>
rtpage1.asp
http://msdn.microsoft.com/library/d...t_oledb-db2.asp
To do this you'll need information such as the provider name, server name,
database name, user name and password. Your system administrator should be
able to supply that information.
(cross-postings removed)
David Portas
--
Please reply only to the newsgroup
--|||Thanks for the reply.
Currently we can query the database via a webpage interface.
I have looked at the code behind the webpage and it consists of some
javascript.
I am guessing but it looks like the webpage sends the request to the
webserver
which I assume passes it to the SQL server.
Is it possible that the computer i work on cant talk to the sql server
directly?
I need to know where to go from here...
Cheers
-Al
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:ereU30F0DHA.2308@.TK2MSFTNGP11.phx.gbl...
quote:
> You need to ask whoever is administering your servers what technology is
> used for accessing the DB2 database. Microsoft has a product called Host
> Integration Server which can connect to DB2 systems. It is also possible
to
quote:
> link Microsoft SQLServer to external data sources such as DB2, but without
> more information about what system you have in place it's difficult to
give
quote:
> a useful answer to your question.
> Assuming you are provided with an OLEDB or ODBC connection to the database
> you can use ADO to access your data from within Visual Basic.
>
http://msdn.microsoft.com/library/d...ostartpage1.asp[QUOT
E]
>[/QUOTE]
http://msdn.microsoft.com/library/d...t_oledb-db2.asp[
QUOTE]
> To do this you'll need information such as the provider name, server name,
> database name, user name and password. Your system administrator should be
> able to supply that information.
>
> (cross-postings removed)
> --
> David Portas
> --
> Please reply only to the newsgroup
> --
>[/QUOTE]
DB2 & SQL server?
Hi Folks,
We have a DB2 database on a WAN at work. I want to access the database from
some Visual Basic for Applications code that I have written at work.
The database itself is not directly accessable and as it was described to me
is "buffered"
from the users by a second computer which passes on requests for data.
I assume that this intermediary computer would be whats called a SQL server?
If my assumption above is correct is it possible to get a query to the
server which
it will accept and reply to?
Anyone?
Cheers
-AlReplied in microsoft.public.sqlserver.connect
--
David Portas
--
Please reply only to the newsgroup
--|||Hi!
I work as a Journalist with PC WORLD magazine. I would like to obtain recent news about
SQL and other news. You can e mail them to me and we would be glad to publish them in
our magazine.
Thanking You,
Anusha Kirubaharan
We have a DB2 database on a WAN at work. I want to access the database from
some Visual Basic for Applications code that I have written at work.
The database itself is not directly accessable and as it was described to me
is "buffered"
from the users by a second computer which passes on requests for data.
I assume that this intermediary computer would be whats called a SQL server?
If my assumption above is correct is it possible to get a query to the
server which
it will accept and reply to?
Anyone?
Cheers
-AlReplied in microsoft.public.sqlserver.connect
--
David Portas
--
Please reply only to the newsgroup
--|||Hi!
I work as a Journalist with PC WORLD magazine. I would like to obtain recent news about
SQL and other news. You can e mail them to me and we would be glad to publish them in
our magazine.
Thanking You,
Anusha Kirubaharan
Thursday, March 22, 2012
DB Structural changes and reports
Our software is going through some changes, in the next 6 months the database
structure will have changed. I have written reports against the current
structure, is there any "easier" way to update reports other than going in
and giving an alias for the "new field name's"? I attempted this with the
most simplistic report we have and even though the change to the query was
just an alias it required me to change each field manually.
Is there an easier way? Maybe edit the rdl direct?
Thanks for any help.You could create a view which has the old names. Then edit the RDL to use
that instead of the current table name.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"DigitalVixen" <DigitalVixen@.discussions.microsoft.com> wrote in message
news:358965CE-B1EA-44E0-92BB-753631D9105B@.microsoft.com...
> Our software is going through some changes, in the next 6 months the
> database
> structure will have changed. I have written reports against the current
> structure, is there any "easier" way to update reports other than going in
> and giving an alias for the "new field name's"? I attempted this with the
> most simplistic report we have and even though the change to the query was
> just an alias it required me to change each field manually.
> Is there an easier way? Maybe edit the rdl direct?
> Thanks for any help.|||Thanks for the quick reply ;) Will this take care of the stored procedures
as well as tables?
"Bruce L-C [MVP]" wrote:
> You could create a view which has the old names. Then edit the RDL to use
> that instead of the current table name.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "DigitalVixen" <DigitalVixen@.discussions.microsoft.com> wrote in message
> news:358965CE-B1EA-44E0-92BB-753631D9105B@.microsoft.com...
> > Our software is going through some changes, in the next 6 months the
> > database
> > structure will have changed. I have written reports against the current
> > structure, is there any "easier" way to update reports other than going in
> > and giving an alias for the "new field name's"? I attempted this with the
> > most simplistic report we have and even though the change to the query was
> > just an alias it required me to change each field manually.
> >
> > Is there an easier way? Maybe edit the rdl direct?
> >
> > Thanks for any help.
>
>|||If you are using stored procedures then this is easier. Either you modify
the stored procedure to alias the fields in which case you don't need to
have a view or you create a view that does the aliasing and then modify the
stored procedure. Either way, if the change is in the stored procedure you
don't have to make any change to the report.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"DigitalVixen" <DigitalVixen@.discussions.microsoft.com> wrote in message
news:31CA7232-F5DA-494B-A908-44ACA4C2BC76@.microsoft.com...
> Thanks for the quick reply ;) Will this take care of the stored
> procedures
> as well as tables?
> "Bruce L-C [MVP]" wrote:
>> You could create a view which has the old names. Then edit the RDL to use
>> that instead of the current table name.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "DigitalVixen" <DigitalVixen@.discussions.microsoft.com> wrote in message
>> news:358965CE-B1EA-44E0-92BB-753631D9105B@.microsoft.com...
>> > Our software is going through some changes, in the next 6 months the
>> > database
>> > structure will have changed. I have written reports against the
>> > current
>> > structure, is there any "easier" way to update reports other than going
>> > in
>> > and giving an alias for the "new field name's"? I attempted this with
>> > the
>> > most simplistic report we have and even though the change to the query
>> > was
>> > just an alias it required me to change each field manually.
>> >
>> > Is there an easier way? Maybe edit the rdl direct?
>> >
>> > Thanks for any help.
>>
structure will have changed. I have written reports against the current
structure, is there any "easier" way to update reports other than going in
and giving an alias for the "new field name's"? I attempted this with the
most simplistic report we have and even though the change to the query was
just an alias it required me to change each field manually.
Is there an easier way? Maybe edit the rdl direct?
Thanks for any help.You could create a view which has the old names. Then edit the RDL to use
that instead of the current table name.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"DigitalVixen" <DigitalVixen@.discussions.microsoft.com> wrote in message
news:358965CE-B1EA-44E0-92BB-753631D9105B@.microsoft.com...
> Our software is going through some changes, in the next 6 months the
> database
> structure will have changed. I have written reports against the current
> structure, is there any "easier" way to update reports other than going in
> and giving an alias for the "new field name's"? I attempted this with the
> most simplistic report we have and even though the change to the query was
> just an alias it required me to change each field manually.
> Is there an easier way? Maybe edit the rdl direct?
> Thanks for any help.|||Thanks for the quick reply ;) Will this take care of the stored procedures
as well as tables?
"Bruce L-C [MVP]" wrote:
> You could create a view which has the old names. Then edit the RDL to use
> that instead of the current table name.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "DigitalVixen" <DigitalVixen@.discussions.microsoft.com> wrote in message
> news:358965CE-B1EA-44E0-92BB-753631D9105B@.microsoft.com...
> > Our software is going through some changes, in the next 6 months the
> > database
> > structure will have changed. I have written reports against the current
> > structure, is there any "easier" way to update reports other than going in
> > and giving an alias for the "new field name's"? I attempted this with the
> > most simplistic report we have and even though the change to the query was
> > just an alias it required me to change each field manually.
> >
> > Is there an easier way? Maybe edit the rdl direct?
> >
> > Thanks for any help.
>
>|||If you are using stored procedures then this is easier. Either you modify
the stored procedure to alias the fields in which case you don't need to
have a view or you create a view that does the aliasing and then modify the
stored procedure. Either way, if the change is in the stored procedure you
don't have to make any change to the report.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"DigitalVixen" <DigitalVixen@.discussions.microsoft.com> wrote in message
news:31CA7232-F5DA-494B-A908-44ACA4C2BC76@.microsoft.com...
> Thanks for the quick reply ;) Will this take care of the stored
> procedures
> as well as tables?
> "Bruce L-C [MVP]" wrote:
>> You could create a view which has the old names. Then edit the RDL to use
>> that instead of the current table name.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "DigitalVixen" <DigitalVixen@.discussions.microsoft.com> wrote in message
>> news:358965CE-B1EA-44E0-92BB-753631D9105B@.microsoft.com...
>> > Our software is going through some changes, in the next 6 months the
>> > database
>> > structure will have changed. I have written reports against the
>> > current
>> > structure, is there any "easier" way to update reports other than going
>> > in
>> > and giving an alias for the "new field name's"? I attempted this with
>> > the
>> > most simplistic report we have and even though the change to the query
>> > was
>> > just an alias it required me to change each field manually.
>> >
>> > Is there an easier way? Maybe edit the rdl direct?
>> >
>> > Thanks for any help.
>>
Subscribe to:
Posts (Atom)