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!

Using SQL Server 2000 and OLEDB

Status
Not open for further replies.

dvader0571

Programmer
Oct 8, 2003
19
US
I am designing an application in VC++ using the Native SQLOLEDB.1 driver. I have no problems executing and accessing the results from a regular stored procedure in our SQL Server 2000 repository. However, as soon as I try and connect to a Stored Procedure that returns more than 1 result set (multiple Selects) I get weird results.

Does the SQLOLEDB.1 driver support multiple queries in SQL Server 2000?

Thanks!
 
Sure does, assuming you have a reasonably up-to-date version. What "weird results" are you getting.
 
Hey, thanks for the info. I do feel better knowing that. I am writing a VC++ program using OLE DB Consumer Templates. It gets to the point where it tries to get the UseMultipleResults pointer from the Provider (SQL Server 2000) and tells me DB_E_ERRORSOCCURED. That is not very descriptive, however I wanted to make sure it wasn't the driver (process of elimination). This means basically it is probably my code.

Thanks again!
 
One thing to check....(I'm not familiar with that error, so I'm taking a 'stab in the dark')...

Check to see if the database is set to Auto Close. That means that every time SQL Server thinks the connection is done, it closes the database and it needs to be reopened/reconnected.

It could be that after one result is returned, the database is closing the connection (auto close) and the rest of the job is failing.

-SQLBill
 
Great, thanks for the info. Currently Auto Close if OFF in our DB. It's got to do with the code. SQL appears to be running just fine.

Thanks for your tips :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top