Mega Code Archive

 
Categories / VisualBasic Script / Access
 

Creating a Recordset Using a Connection String

Sub CreateRecordset1()     'Declare and instantiate the recordset     Dim rst As ADODB.Recordset     Set rst = New ADODB.Recordset     'Open the recordset     rst.Open "Select * From Employees", CurrentProject.Connection     'Print its contents     Debug.Print rst.GetString     'Close and destroy the recordset     rst.Close     Set rst = Nothing End Sub