Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rs.MoveFirst giving error 3021 but I have at least 3 records 1

Status
Not open for further replies.

thevillageinn

Technical User
Feb 28, 2002
124
US
I am creating a recordset with a simple select statement, which returns the desired records (with my current test data that's 3 records)

I use rs.MoveLast to help me get an accurate count and then rs.MoveFirst to start examining the data.

rs.MoveFirst gives me error 3021, No current record.

Is this some sort of cursor problem? I have two other select statements pulling data from the same table and they work...My tables are local, I'm in A97, and I'm getting frustrated. I know I can probably just put some error handling in, but this code worked earlier.
 
I use Access 2000 and ADO recordset as a rule, but you are right a forward only cursor will not allow you to move backward in the recordset. Normally, an updatable recordset will allow backward movement and a non-updatable recordset will be forward only. The default is probably forward only cursor. Make it a dynaset and you should be okay.
 
thanks for the response. I tried changing my cursor and how I was opening the recordset and such, all to no avail. Then (after a nice large lunch) I returned, and this time I bothered to break my code in more places, and found the error.

I can't believe I spent all this time debugging *SO* poorly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top