Dim rst As ADODB.Recordset
Dim lngID As Long
Set rst = New ADODB.Recordset
lngID = 2 ' код записи которую нужно найти
rst.Open "select * from Таблица where id = " & ingID, CurrentProject.Connection, adOpenForwardOnly, adLockReadOnly
If rst.BOF And rst.EOF Then ' рекордсет пустой
Else
Debug.Print rst![Поле1]
Debug.Print rst![Поле3]
End If
rst.Close
set rst = Nothing
|