Mega Code Archive

 
Categories / VisualBasic Script / Access
 

Opening a Recordset Directly

Sub OpenRst_Directly() Dim rst As ADODB.Recordset    Set rst = New ADODB.Recordset    With rst       .Source = "Select * From Employees"       .ActiveConnection = CurrentProject.Connection       .Open    End With    MsgBox rst.Fields(1)    rst.Close    Set rst = Nothing End Sub