Sub CommandObject()
'Declare a Recordset and a Command object
Dim rst As ADODB.Recordset
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
cmd.CommandText = "Select * from Employees"
cmd.ActiveConnection = CurrentProject.Connection
Set rst = cmd.Execute
Debug.Print rst.GetString
rst.Close
Set cmd = Nothing
End Sub
|