If anyone can help me with this I really would appreciate it! Thanks guys!How to re-use data returned in recordset using classic ASP?
I think I am missing something here.
When you retrieve data from a database, that data will continue to be available until the web page is closed or you do another retrieve of data.
If you are selecting multiple rows of data and you want this preserved for later use then either assign the data to variables or assign the data to an array.How to re-use data returned in recordset using classic ASP?
Set rs = cn.Execute(';SELECT * FROM Table1';)
If Not rs.EOF Then
rs.MoveFirst
While Not rs.EOF
%%26gt;Hello %26lt;%= rs(';FirstName';).Value %%26gt; %26lt;%= rs(';LastName';).Value %%26gt;%26lt;%
Set rs2 = cn.Execute(';SELECT * FROM Table2';)
If Not rs2.EOF Then
rs2.MoveFirst
While Not rs2.EOF
%%26gt;%26lt;%= rs(';FirstName';).Value %%26gt; %26lt;%= rs(';LastName';).Value %%26gt;
%26lt;%
%26lt;%= rs2(';Address';).Value %%26gt;%26lt;%
Wend 'Not rs2.EOF
End If 'Not rs2.EOF
rs.Close
Set rs = Nothing
rs2.Close
Set rs2 = Nothing
No comments:
Post a Comment