I having problems seting the Report.DataSource to a ADODB.RS at runtime.
I've created a new Blank report using Application.NewReport and am trying to set the datasource to a ADODB.RS. It gives me a subscript out of range error.
here is my code:
Dim dbConnection As New ADODB.Connection
strQuery = "SELECT * FROM tblCategory INNER JOIN tblInventory ON tblCategory.categoryId = tblInventory.categoryId"
dbConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & gstrDbase
dbConnection.Open
Set rsResults = dbConnection.Execute(strQuery)
Set Report1 = Application.NewReport
Report1.Database.SetDataSource rsResults, 3, 1
Set CRWizard.CrystalReport = Report1
CRWizard.DisplayReportWizard
I've created a new Blank report using Application.NewReport and am trying to set the datasource to a ADODB.RS. It gives me a subscript out of range error.
here is my code:
Dim dbConnection As New ADODB.Connection
strQuery = "SELECT * FROM tblCategory INNER JOIN tblInventory ON tblCategory.categoryId = tblInventory.categoryId"
dbConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & gstrDbase
dbConnection.Open
Set rsResults = dbConnection.Execute(strQuery)
Set Report1 = Application.NewReport
Report1.Database.SetDataSource rsResults, 3, 1
Set CRWizard.CrystalReport = Report1
CRWizard.DisplayReportWizard