B
Brad Bruber
The following code will generate a Run Time error 3021- "Either BOF or EOF is
true or the current record has been deleted ..". I am running it in Word VBA
in a Netware access table. The problem is obviously one of timing because
upon going into debug, I can step through he command without trouble. How can
I know that the open command has completed?
s_cnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curDataBase &
";Persist Security Info=False"
Set cnn2 = New ADODB.Connection
cnn2.Open s_cnn
Set rshtop = New ADODB.Recordset
rshtop.CursorLocation = adUseClient
rshtop.CursorType = adOpenForwardOnly '
rshtop.LockType = adLockReadOnly 'adLockOptimistic
rshtop.Open sqlrecordset, cnn2 ', adOpenDynamic, adLockOptimistic
'+=============================================================
' When the Access table is small, i.e.
' sqlreccordset = "Select * from ALLTopicalss" & i_session & " ORDER BY
Topic, SDESsort, FileNo",
' this procedure often errs out, as though there are no records in
Alltopicalss & i_session.
' This is not true. Step, F8, through rshtop.movefirst, then F5 to continue.
'-=============================================================
rshtop.MoveFirst
true or the current record has been deleted ..". I am running it in Word VBA
in a Netware access table. The problem is obviously one of timing because
upon going into debug, I can step through he command without trouble. How can
I know that the open command has completed?
s_cnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curDataBase &
";Persist Security Info=False"
Set cnn2 = New ADODB.Connection
cnn2.Open s_cnn
Set rshtop = New ADODB.Recordset
rshtop.CursorLocation = adUseClient
rshtop.CursorType = adOpenForwardOnly '
rshtop.LockType = adLockReadOnly 'adLockOptimistic
rshtop.Open sqlrecordset, cnn2 ', adOpenDynamic, adLockOptimistic
'+=============================================================
' When the Access table is small, i.e.
' sqlreccordset = "Select * from ALLTopicalss" & i_session & " ORDER BY
Topic, SDESsort, FileNo",
' this procedure often errs out, as though there are no records in
Alltopicalss & i_session.
' This is not true. Step, F8, through rshtop.movefirst, then F5 to continue.
'-=============================================================
rshtop.MoveFirst