Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<b>Having Problems passing a ADO.RS to a Report.DataSource</b>

Status
Not open for further replies.

ktrang

Programmer
May 24, 2002
8
CA
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top