Private Sub org_GetList()
Dim sSQL As String, rs As ADODB.Recordset, r As Long, boShow As Boolean, upID As Variant
On Error GoTo L_Err
Set rs = New ADODB.Recordset
sSQL = "SELECT * from зОрганизация order by Название"
rs.Open sSQL, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
If rs.EOF And rs.BOF Then Exit Sub
If Not rs.BOF Then rs.MoveFirst
Do While Not rs.EOF
...
rs.MoveNext
Loop
L_Exit: Set rs = Nothing: Exit Sub
L_Err: MsgBox Err.Description & " (" & Err.Number & ")", vbExclamation, "org_GetList": GoTo L_Exit
End Sub
|