Samer
September 13th, 1999, 11:49 PM
- I created a report in Crystal Reports
- It works fine in the report designer
- Now I want to make the report execute from within my VB App
- The VB App is using Access for a back end. The App is on the client PC, the .MDB is on a Novell mapped drive.
- I know the location of the MDB, the location of the .RPT (Crystal Reports report file)
Here is my code (that bombs out claiming I have Invalid Logon Parameters):
'gs_AppPath is the path to the RPT file
'gs_DBName is the path and file name of the MDB
rpt21J.ReportFileName = gs_AppPath & "\Reconsideration.rpt"
rpt21J.Destination = crptToWindow
'rpt21J.Connect = "DSN=MS Access 97 Database;UID=admin;PWD=;DSQ=" & gs_DBName
iResultCode = rpt21J.PrintReport
How do I do this? I've been pulling my hair trying to find a simple example of how to print reports from within VB and all the help files do is tell me to use the designer! Does anyone have a code fragment that identifies a report, and the .MDB and then runs the report. While the .RPT has a pointer to my design time .MDB, when this deploys to the users, the location of the .MDB will vary. I can retrieve that location with ease, I just need the report to know its there, and use it. Right now, I get this "Invalid Logon Parameters" error and can't find a way around it. If you can help, please reply to samern@ix.netcom.com.
TIA,
Samer
- It works fine in the report designer
- Now I want to make the report execute from within my VB App
- The VB App is using Access for a back end. The App is on the client PC, the .MDB is on a Novell mapped drive.
- I know the location of the MDB, the location of the .RPT (Crystal Reports report file)
Here is my code (that bombs out claiming I have Invalid Logon Parameters):
'gs_AppPath is the path to the RPT file
'gs_DBName is the path and file name of the MDB
rpt21J.ReportFileName = gs_AppPath & "\Reconsideration.rpt"
rpt21J.Destination = crptToWindow
'rpt21J.Connect = "DSN=MS Access 97 Database;UID=admin;PWD=;DSQ=" & gs_DBName
iResultCode = rpt21J.PrintReport
How do I do this? I've been pulling my hair trying to find a simple example of how to print reports from within VB and all the help files do is tell me to use the designer! Does anyone have a code fragment that identifies a report, and the .MDB and then runs the report. While the .RPT has a pointer to my design time .MDB, when this deploys to the users, the location of the .MDB will vary. I can retrieve that location with ease, I just need the report to know its there, and use it. Right now, I get this "Invalid Logon Parameters" error and can't find a way around it. If you can help, please reply to samern@ix.netcom.com.
TIA,
Samer