Error! Please help!!!! | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Error! Please help!!!!

I have a SQL SERVER 7.0 and lan clients use VB APP. I open a recordset (never be refreshed) with cursorType=adOpenStatic and cursorLock=adLockOptimistic. The program is opened more then once. While filterin recordset the program displays an error message: "RUN-TIME ERROR ‘-2147467259(80004005)’" (and the ‘ok’ button) I use stored procedures for inserting and deleting data. There is and another recordset that be refreshed when inserting or deleting data.
This two recordsets and the db connection are never closed until the program is closed normally.

This is a rather generic error message and has many potential causes. If you do a search on the error message in Google, there are lots of hits and lot of different causes and solutions. I don’t enough about your particular circumstance, so I can’t offer specific help. But if you do a search in Google, perhaps one of the hits applies to your situation and can provide some guidance. Or perhaps some other member of this forum has experience with this error and can help out.
——————
Brad M. McGehee
Webmaster
SQL-Server-Performance.Com
Here is the assumption and solution : SQL Server can only open one ForwardOnly cursor at a time on a connection, because SQL Server can only process one active statement at a time per connection. When you try to open more than one ForwardOnly ADO recordset at a time on a single Connection, only the first ADO recordset is actually opened on the Connection object. New, separate connections are created for subsequent ForwardOnly cursors. To resolve this use a different cursor type, change the cursor location to adUseClient or close the first recordset before opening another on the same connection/transaction. You must either use and then close the recordsets within the transaction or preserve the cursors. HTH
Satya SKJ
]]>