BarryCrosby
Technical User
All,
I've got a problem with a piece of code accessing an oracle database.
I've used the same piece of code to access other tables and it returns data successfully but when I try the following it errors saying:
Either BOF or EOF is true, or the current record has been deleted. Requested operation requires a current record
Code snippet
rs.Open "INCIDENT", oconn, adOpenDynamic, adLockOptimistic, adCmdTable
Set rs = New ADODB.Recordset
rs.Open "SELECT INCIDENT.INCIDENT_ID FROM SA.INCIDENT INCIDENT WHERE INCIDENT.INCIDENT_REF > 303750", db, adOpenDynamic, adLockBatchOptimistic
Do While Not rs.EOF
MsgBox ("looping")
row = ""
For icount = 0 To rs.Fields.Count - 1
row = row & rs.Fields(icount).Value
Debug.Print rs.Fields(0).Value
Next icount
txt = txt & Mid$(row, 3) & vbCrLf
rs.MoveNext
Loop
rs.MoveLast
rs.Close
It does not even display the Msgbox ("looping").
Any ideas?
Thanks
Barry
I've got a problem with a piece of code accessing an oracle database.
I've used the same piece of code to access other tables and it returns data successfully but when I try the following it errors saying:
Either BOF or EOF is true, or the current record has been deleted. Requested operation requires a current record
Code snippet
rs.Open "INCIDENT", oconn, adOpenDynamic, adLockOptimistic, adCmdTable
Set rs = New ADODB.Recordset
rs.Open "SELECT INCIDENT.INCIDENT_ID FROM SA.INCIDENT INCIDENT WHERE INCIDENT.INCIDENT_REF > 303750", db, adOpenDynamic, adLockBatchOptimistic
Do While Not rs.EOF
MsgBox ("looping")
row = ""
For icount = 0 To rs.Fields.Count - 1
row = row & rs.Fields(icount).Value
Debug.Print rs.Fields(0).Value
Next icount
txt = txt & Mid$(row, 3) & vbCrLf
rs.MoveNext
Loop
rs.MoveLast
rs.Close
It does not even display the Msgbox ("looping").
Any ideas?
Thanks
Barry