Help! Disconnected recordsets ADO and SQL Server 
Author Message
 Help! Disconnected recordsets ADO and SQL Server

Hi all,

I am converting an app from DAO and Access 97 to ADO and SQL  Server, and I
am having a problem with disconnected recordsets.  I want to read a list of
data out of the database once when the system first starts up (i.e.  a list
of the doctors available in an office) and then close the connection between
the recordset and the database.  I had no problem doing this with Access 97
as the database:

set rs.ActiveConnection = Nothing

But with SQL server I get the error message that the operation is illegal if
the recordset is still open.

I saw someone recommended creating a new recordset and then iterating
through all the fields and records of the first one to create the second
one, but that sounds like it is going to take a lot of time.  Does anyone
have any other ideas?  Thanks!

John



Thu, 23 May 2002 03:00:00 GMT  
 Help! Disconnected recordsets ADO and SQL Server
The problem may be that the 'CursorLocation' property of the active connection or the recordset may not be set to 'adUseClient'.  You will also want to change the 'CursorType' to 'adOpenStatic' and the 'LockType' to 'adLockBatchOptimistic' if you haven't already done so.

I hope this helps,

Scott Janouskovec

Posted via: http://forums.webf1.com
Currently with 204,395 posts to search and track.

Quote:

> Hi all,

> I am converting an app from DAO and Access 97 to ADO and SQL  Server, and I
> am having a problem with disconnected recordsets.  I want to read a list of
> data out of the database once when the system first starts up (i.e.  a list
> of the doctors available in an office) and then close the connection between
> the recordset and the database.  I had no problem doing this with Access 97
> as the database:

> set rs.ActiveConnection = Nothing

> But with SQL server I get the error message that the operation is illegal if
> the recordset is still open.

> I saw someone recommended creating a new recordset and then iterating
> through all the fields and records of the first one to create the second
> one, but that sounds like it is going to take a lot of time.  Does anyone
> have any other ideas?  Thanks!

> John



Thu, 23 May 2002 03:00:00 GMT  
 Help! Disconnected recordsets ADO and SQL Server
Scott,

Thanks for the information. it worked exactly like you said.  As soon as I
went to a client cursor I had no problem.  Thanks!

John

Quote:
> The problem may be that the 'CursorLocation' property of the active

connection or the recordset may not be set to 'adUseClient'.  You will also
want to change the 'CursorType' to 'adOpenStatic' and the 'LockType' to
'adLockBatchOptimistic' if you haven't already done so.
Quote:

> I hope this helps,

> Scott Janouskovec

> Posted via: http://forums.webf1.com
> Currently with 204,395 posts to search and track.




Quote:

> > Hi all,

> > I am converting an app from DAO and Access 97 to ADO and SQL  Server,
and I
> > am having a problem with disconnected recordsets.  I want to read a list
of
> > data out of the database once when the system first starts up (i.e.  a
list
> > of the doctors available in an office) and then close the connection
between
> > the recordset and the database.  I had no problem doing this with Access
97
> > as the database:

> > set rs.ActiveConnection = Nothing

> > But with SQL server I get the error message that the operation is
illegal if
> > the recordset is still open.

> > I saw someone recommended creating a new recordset and then iterating
> > through all the fields and records of the first one to create the second
> > one, but that sounds like it is going to take a lot of time.  Does
anyone
> > have any other ideas?  Thanks!

> > John



Fri, 24 May 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Run SQL Statement Against Disconnected ADO Recordset

2. exec SQL on ADO disconnected recordsets?

3. Udate SQL server using disconnected recordsets

4. Udate SQL server using disconnected recordsets

5. HELP - ADO recordset clone failing on SQL Server 7

6. VB6 - CR7 - SQL Server - Want to send either SQL or ADO recordset to report

7. ADO fails to release Recordset cursor after opening disconnected Recordset

8. Need Help Reporting on Multiple ADO (Disconnected) Recordsets

9. I need help disconnecting fro SQL Server....

10. Important FYI - Multiple Recordsets w ADO/SQL Server

11. Important FYI - Multiple Recordsets w ADO/SQL Server

12. Indexes in SQL Server with ADO Recordset

 

 
Powered by phpBB® Forum Software