Sub CreateRecordset3()
Dim cnn As ADODB.Connection
Dim rst1 As ADODB.Recordset
Dim rst2 As ADODB.Recordset
Set cnn = New ADODB.Connection
Set rst1 = New ADODB.Recordset
Set rst2 = New ADODB.Recordset
Set cnn = CurrentProject.Connection
rst1.ActiveConnection = cnn
rst1.Open "Select * From Employees"
rst2.ActiveConnection = cnn
rst2.Open "Select * From Products"
Debug.Print rst1.GetString
Debug.Print rst2.GetString
rst1.Close
rst2.Close
cnn.Close
Set rst1 = Nothing
Set rst2 = Nothing
Set cnn = Nothing
End Sub
|