mikej28621
MIS
I was wondering if anyone had any basic ado examples of progammically opening a local Access table in the current database and moving thru it.
Thanks in advance.
MJ
Thanks in advance.
MJ
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim lRst_RecSet As ADODB.Recordset
Dim lStr_SQLStmt As String
Set lRst_RecSet = New ADODB.Recordset
lRst_RecSet.ActiveConnection = CurrentProject.Connection
lStr_SQLStmt = "SELECT <Field List> " & _
"FROM <Table Name> " & _
"WHERE <Field Name> = '" & <String Value> & "' " & _
"ORDER BY <Field List>"
lRst_RecSet.Open lStr_SQLStmt, , adOpenForwardOnly, adLockReadOnly
If (lRst_RecSet.State = adStateOpen) Then
If ((lRst_RecSet.BOF = False) And (lRst_RecSet.EOF = False)) Then
lRst_RecSet.MoveFirst
Do While (lRst_RecSet.EOF = False)
<Process The Record>
lRst_RecSet.MoveNext
Loop
End If
lRst_RecSet.Close
End If
Set lRst_RecSet = Nothing