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!

how to use recordset.requery? (MS access+asp)

Status
Not open for further replies.

avivit

Technical User
Jul 5, 2000
456
IL
Maybe I did not understand the use of requrey:
I created a recordset and when finished with it, I wanted to change the recordset instead of closing the first and set a new one.
I used:
con.Open ...
set rs=server.CreateObject("adodb.recordset")
selectQuery="select field1 from table1 where field2='value'"
rs.Open selectQuery,con ,3, 3
'running a loop in the recordset UNTIL EOF, etc.
'THEN
selectQuery="select field1 from table1 where field2='ANOTHER VALUE'"
rs.requery selectQuery,con ,3, 3
rs.close
set rs=Nothing
con.close
set con=Nothing

Where did I do wrong? I am getting an error.

Thanks
 
Requery simply re-fetches the information, like a refresh. You cannot include the
Code:
selectQuery,con ,3, 3
to change the source of the recordset.
Rob Marriott
rob@career-connections.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top