
Crystal 8.5/VB.NET (Connecting)
I am sending you information for crystal 8.5 Hope this will give you the
direction in .NET platform.
dim objcrapp as craxdrt.application
dim objreport as CRAXDRT.report
dim objDB as craxdrt.database
dim sDLLName as string
sDLLName = "p2sodbc.dll"
set objcrapp = new craxdrt.application
set objreport = objcrapp.netreport
set objdb = objreport.database
set objreport = objcrapp.openreport("report path")
objdb.logonserver sDLLName, DSN, "DatabseName", UserID, Password
objDB.Verify 'if error then exit sub with a user defined error
This works for me with out promption for userID and password.
If this is what exactly you have done and still it is prompting for user id
then check for the report design. Have you used trusted connection or SQL
log on?
If you have used trusted connection then the report will run only on your
machine.
Hope this helps.
--SriT
Quote:
> I have an RPT file that I've created that pulls from our SQL Server. The
> conclusion I've come to is that in order to open this report and pull data
> from SQL, I have to use SetDataSource and set it to a DataSet with the
> appropriate Tables/Data in it. Is this the case? I'd really like my end
> users to not have to log on to our SQL Server directly (don't mind if it's
> in underlying code). If I just set the ReportSource of the Viewer to the
> file, it prompts me for a SQL login and even if I enter it correctly, it
> says Logon Failed. Any idea how I can embed all the connection info into
> the RPT file or some how cause it not to need a dataset because the entire
> point was that our data department could create the reports on their own
and
> not have to come running to programming all the time.
> Thanks a million,
> Jim