rod
Jan 20th, 2000, 04:04 PM
I've created a report form using crystal 5.0 to display my data from ms access 97. I then called this report from VB 5.0 with the following code:
rptSalaryDetail.DataFiles(0) = "MyMDB.MDB"
rptSalaryDetail.Connect = "MS Access; PWD=MyPassword"
rptSalaryDetail.ReportFileName = "MyReport.RPT"
rptSalaryDetail.Destination = crptToWindow
rptSalaryDetail.Action = 1
Now here is the problem. The report (MyReport.RPT) contains a sub-report (MySub.RPT) which displays some information from the same database (MyMDB.MDB). Since the database is password protected, an input box appears everytime I generate the report from VB, asking for the database password, which I have already declared (rptSalaryDetail.Connect = "MS Access; PWD=MyPassword"). I suspect that the password the system is asking is for the subreport. I have remove the subreport(MySub.RPT) from the main report (MyReport.RPT) and run again the application, and it resulted to a "No Error" report.
How do you set the connection string of a crystal sub-report from VB?
rptSalaryDetail.DataFiles(0) = "MyMDB.MDB"
rptSalaryDetail.Connect = "MS Access; PWD=MyPassword"
rptSalaryDetail.ReportFileName = "MyReport.RPT"
rptSalaryDetail.Destination = crptToWindow
rptSalaryDetail.Action = 1
Now here is the problem. The report (MyReport.RPT) contains a sub-report (MySub.RPT) which displays some information from the same database (MyMDB.MDB). Since the database is password protected, an input box appears everytime I generate the report from VB, asking for the database password, which I have already declared (rptSalaryDetail.Connect = "MS Access; PWD=MyPassword"). I suspect that the password the system is asking is for the subreport. I have remove the subreport(MySub.RPT) from the main report (MyReport.RPT) and run again the application, and it resulted to a "No Error" report.
How do you set the connection string of a crystal sub-report from VB?