Re: Database access in custom code by Craig
Craig
Tue Mar 07 17:50:47 CST 2006
Firstly I urge you to try out your custom code from outside of Reporting
Services. This will give you 100 times better error messages plus you will
be able to debug your code which you can't do if you are writing the code in
the reports code.
After you have completed this and its all working fine then, and only then,
copy the code from the function in to the Code properties of the report.
Now the error you are currently getting is to do with a reference that the
report server is not aware of. To add this reference go to the
Report>Report Properties...>References and click on the "..." to add a new
reference.
Choose the DLL that contains the namespace for the DAO.Recordset and add it
to your report.
Craig
"Tur" <cenci.cristiano@gmail.com> wrote in message
news:1141722816.893159.67500@j33g2000cwa.googlegroups.com...
> Hi Craig, thank you so much for your answer!
>
> I'm writing my custom code in the Code properties of the report, as you
>
> say,
> but I'm not sure how to add the appropriate references in reference
> tab.
>
>
> An example:
> function MyFun(myStr as String) as String
> Dim temp as DAO.Recordset
> return "Nothing"
> end function
>
>
> raises an error: "d:\myPath\myRDL.rdl : [BC30002] 'DAO.Recordset' type
> not defined."
>
>
> I'm not sure of what is the problem...
>