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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recordset Error

Status
Not open for further replies.

rpk2006

Technical User
Apr 24, 2002
225
IN
In one of my table I have just one record with userid, username and password. But whenever I run the following code I receive this error message at line 3. Why?

Run-time error '3021':
Either BOF or EOf is true, or the current record
has been deleted. Requested operation requires a
current record.

---------------------------------------------
1 cmdText1 = "Select userid, R_username from gateway where R_username = '" & txtUsername.Text & "'"
2 Set rs_gateway = cn.Execute(cmdText1)

3 uid = rs_gateway!userid
4 uname = rs_gateway!r_username

--------------------------------------------

Rohit. There is always a new solution for the same problem.

Anonymous
 
Have you checked to see if your recordset has data in it ?
The error described is raised when the recordset is empty.

This my be due to the query string: You need to tell the driver what type of recordset you want to have returned
"Select Fieldname from table where ....", adopenstatic, for instance if you use ADO

The options available are :
adopenstatic
adopenkeyset
adopendynamic
 
I agree with wbeetge idea, be sure to check everything in your program between your Application and your Database. There migth be some error Good luck!


"if light has energy so does the dark, the direction of dark forces is in line with light"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top