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!

Connecting to database with OLEDB driver

Status
Not open for further replies.

hayjude

Programmer
Oct 4, 2001
2
NZ
Using the RDC with VB6 I have a report which needs to be 'pointed' to its database prior to use. ie. I can not be sure of the path to the database. At present I am connecting to an MS Access database but will need to connect to a SQL Server one in the near future.

I have tried the following code.
Code:
For intLoop = 1 To Form3.Report2.Database.Tables.Count
   Form3.Report2.Database.Tables _
   (intLoop).SetTableLocation "G:\Work\Prosper\Working _ 
    Folder\Prosdemo.mdb", "", ""
Next
The above code has not wrapped well in my browser but all in the loop is on one line.

The error message I get is 'No rowset was returned for this table, query, or procedure.' followed by 'Error detected by database DLL'.

The report driver is pdsoledb.dll.

If I use the pdbdao.dll driver this error does not occur.
It seems to me that the oledb report is somehow using the wrong driver.

Any ideas greatly appreciated.

 
I usually get around this by passing a ADO recordset to a report. I then code to obtain a path from something like an .ini file for my application where I can can set up path of the database which can be used in a OLEDB connection string within VB when creating the ADO recordset.

HTH

Nelson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top