-
Runtime Error:3021
whenever i try load the form which contains this code. i get the "runtime error '3021': Either BOF or EOF is true.... "
when i press "debug" button it shows the yellow highlight on "rs1.MoveFirst" line....
plz help me resolve this problem
Code:
Private Sub Form_Load()
Set conn = New ADODB.Connection
conn.ConnectionString = "dsn=sts;uid=system;pwd=ora92"
conn.Open
Set rs1 = New ADODB.Recordset
rs1.ActiveConnection = conn
rs1.Open " select specid from rule "
rs1.MoveFirst
While Not rs1.EOF
Combo1.AddItem rs1(0)
rs1.MoveNext
Wend
Adodc1.Visible = False
End Sub
-
Re: Runtime Error:3021
it means no records have been found in that query
-
Re: Runtime Error:3021
actually it does contain records...
but i dont know y i get that error
-
Re: Runtime Error:3021
how do you know it contains records? the error message indicates that no records have been returned, the table may have records, but the query has not returned them, try changing your query to test
-
Re: Runtime Error:3021
rs1.MoveFirst is unnecessary, just remove it... ;)
-
Re: Runtime Error:3021
thanks friends.... its working now.....
-
Re: Runtime Error:3021
Care to cite what actually solve your problem? Others may encounter the same scenario and your solution may benefit them... :)
-
Re: Runtime Error:3021
i initially had records in the table, wht i did is, i deleted the table itself and created it again and populated with records. even then i was getting error during VB execution. so, i posted the problem here. meanwhile i once exited sql window and tried executing VB. at that time it worked. this is what happened....
thankq very much....