Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: VB6,VBS
Expertise: beginner
Jul 24, 1999



Application Security Testing: An Integral Part of DevOps

Reuse a Recordset's Connection

ADO lets you create a Recordset without creating an explicit Connection object, using the following syntax:

Dim rs As New ADODB.Recordset
rs.Open "Authors", "DSN=Pubs"
If you later want to create another Recordset, but you (correctly) don't want to create another database connection, you can reuse the implicit Connection object that ADO has created for the first Recordset, as in:

Dim rs2 As New ADODB.Recordset
Set rs2.ActiveConnection = rs.ActiveConnection
rs2.Open "Publishers"
or, more simply, with

Dim rs2 As New ADODB.Recordset
rs2.Open "Publishers", rs.ActiveConnection
Francesco Balena
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date