I built my reports in Crystal Reports then imported them to VB into the RDC. I used to use an Access database and to set the database location for the RDC I used this code:
I have now changed over to SQL Server 2000 but nothing I do will allow me to link my reports to the SQL Server database!
I tried adding the Crystal Reports control to the form and this code:
WEBSERVER is the name of the server with SQL running on it
AMSTRACKINGSQL is the name of the database in SQL Server.
When running that code it stops at "crpReport.Action=1" with the error message "Unable to open database"
I also tried to use report.Database.LogOnServer but I couldn't get that to work either!
I also tried making a DSN called AMSTRACKING and used:
But nothing!
please help! thanks
Code:
For I = 1 To Report.Database.Tables.Count
Report.Database.Tables.Item(I).Location = SourceFile 'SourceFile holds the location of the Access database
Next I
I have now changed over to SQL Server 2000 but nothing I do will allow me to link my reports to the SQL Server database!
I tried adding the Crystal Reports control to the form and this code:
WEBSERVER is the name of the server with SQL running on it
AMSTRACKINGSQL is the name of the database in SQL Server.
Code:
crpReport.Connect = "DSN =WEBSERVER;UID = sa;PWD =ams;DSQ =AMSTRACKINGSQL"
crpReport.ReportFileName = App.Path & "\reports\new_nurseprofit.rpt"
crpReport.Action = 1
When running that code it stops at "crpReport.Action=1" with the error message "Unable to open database"
I also tried to use report.Database.LogOnServer but I couldn't get that to work either!
I also tried making a DSN called AMSTRACKING and used:
Code:
crpReport.Connect = "DSN =AMSTRACKING;UID = sa;PWD =ams"
crpReport.ReportFileName = App.Path & "\reports\new_nurseprofit.rpt"
crpReport.Action = 1
But nothing!
please help! thanks