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

Error 3021 1

Status
Not open for further replies.

venusadora

Programmer
Jun 23, 2003
7
AE
I am using vb 6 with sql server 2005 to display data in a third party grid control. The data displays properly, but when trying to use ADO filter to filter data, got an error message like "Error 3021: Either BOF or EOF is true or the current record has been deleted." The filtered data is displaying in the grid control as well as the error message. I am not able to find out the reason for the error since there is data in the recordset.

Could any one please help me to solve this?
 
Single step through your code. It could be that there is more than one query is sent to SQL server, and that not all of them fail. It could also be that there is a re-read frem a refresh of the control, but the recordset is opened only once. It would be really hard to know without seeing your code. Single-stepping through it should at least show you where the pain exactly is.

+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 

Actually, your record set is empty, that’s why you get this error.

You said: “there is data in the recordset”, but, since you use Filter, consider this:
Code:
Rst.Open "Select * From Table", Cnn
Rst.Filter = "SomeField = 'abc'"
...
[blue]...(*)[/blue]
Rst.Close

Rst.Open "Select * From [b]OtherTable[/b]", Cnn
At this time the Filter on Rst is still on, so you are filtering records from OtherTable here, too, and you get an empty record set.

Try, after filtering records and using your record set, set the Filter to ""
In line * put Rst.Filter = ""


Have fun.

---- Andy
 
Thanks for the reply.

I tried the rs.filter = "" statement.

It worked. That was the problem.

Thanks to both of you.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top