But I'm not trying to search backwards...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to run the following code:

Dim RS As New ADODB.Recordset

RS.Open "Labs", CurrentProject.Connection

RS.MoveFirst
RS.Find "[Lab ID] = " & GetCustomProp("Lab ID")


(GetCustomProp is a function that returns the value of custom database
properties. Currently, it returns a numeric 5 for Lab ID.)

The RS.MoveFirst line is in there because the helpfile suggested it was
necessary to set the cursor onto a record before using Find, though the
example they gave didn't do it, so I'm a bit confused on that front.

When I run this code, I get the following error:

Run-time error '-2147217879 (80040e29)':

Rowset does not support scrolling backward.

Can someone explain this to me?
 
Someday I'm going to figure out how it is I can fight with something for an
hour and then solve it myself 30 seconds after I ask for help...

Changing the cursor from the default to adOpenStatic cleared up the problem.
I still don't understand *why* the problem occured with the default forward
only cursor, and would appreciate an explanation, but I'm no longer in crisis.
 
Must be your Lithuanian heritage...:)

Michael Suttkus said:
Someday I'm going to figure out how it is I can fight with something for an
hour and then solve it myself 30 seconds after I ask for help...

Changing the cursor from the default to adOpenStatic cleared up the problem.
I still don't understand *why* the problem occured with the default forward
only cursor, and would appreciate an explanation, but I'm no longer in crisis.

Michael Suttkus said:
I'm trying to run the following code:

Dim RS As New ADODB.Recordset

RS.Open "Labs", CurrentProject.Connection

RS.MoveFirst
RS.Find "[Lab ID] = " & GetCustomProp("Lab ID")


(GetCustomProp is a function that returns the value of custom database
properties. Currently, it returns a numeric 5 for Lab ID.)

The RS.MoveFirst line is in there because the helpfile suggested it was
necessary to set the cursor onto a record before using Find, though the
example they gave didn't do it, so I'm a bit confused on that front.

When I run this code, I get the following error:

Run-time error '-2147217879 (80040e29)':

Rowset does not support scrolling backward.

Can someone explain this to me?
 
Back
Top