ADO Connection Reuse 
Author Message
 ADO Connection Reuse

Can i reuse the ado connection object after a select has returned a RS
via the connection. If so can i perform and update on the same records
as returned in the recordset. What implications will this have for
record locking.

Sent via Deja.com
http://www.*-*-*.com/



Wed, 04 Jun 2003 00:46:57 GMT  
 ADO Connection Reuse
If your "reuse" means use the same connection object serval times in one
project, of course you can.
I usually use the connection object and recordset object like this sample:

  Dim cn As New ADODB.Connection
  Dim rst As New ADODB.Recordset

  cn.Open ConnectionString

  ' if you want update the recordset and database, you should give a lock
  rst.Open "select id,name from person where id=1", cn, adOpenDynamic,
adLockOptimistic, adCmdText
  rst!Name = "John"
  rst.Update

  rst.Close


Quote:
> Can i reuse the ado connection object after a select has returned a RS
> via the connection. If so can i perform and update on the same records
> as returned in the recordset. What implications will this have for
> record locking.

> Sent via Deja.com
> http://www.deja.com/



Wed, 04 Jun 2003 09:34:49 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Reusing ADO connections in HTA applications

2. Unable to reuse ADO.Recordset connection using VBA script in Excel

3. Reuse application-level connection object

4. Reusing Connection objects with MSDAIPP

5. Question re: reusing the same ADODB.Connection in my VB app

6. Connection reuse

7. Connection Reuse

8. Unclear on Reuse of Connection & Recordset Objects

9. Reusing VBA/Access Forms thru DAO/ODBC/ADO

10. Problem reusing ADO.Recordset object in VBA script in Excel

11. HowTo: Reuse ADO Command Params w/ Access 2K DB

12. Connection Problem - ado failover connection

 

 
Powered by phpBB® Forum Software