English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

In classic ASP Is it possible to have one recordset which pulls all data from a table in the database and then create a second recordset on the same page which uses data in the original recordset? I just want a quick fix for right now to get this page working and I will make it better later. I have a need to use ALL data fields in the table in one section of this ASP page and then only SPECIFIC records from the table in another section of the same page.

If anyone can help me with this I really would appreciate it! Thanks guys!

2007-03-26 20:24:26 · 2 answers · asked by UBigDummie 1 in Computers & Internet Programming & Design

2 answers

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.

2007-03-26 20:40:10 · answer #1 · answered by AnalProgrammer 7 · 0 0

Set rs = cn.Execute("SELECT * FROM Table1")
If Not rs.EOF Then
rs.MoveFirst
While Not rs.EOF
%>Hello <%= rs("FirstName").Value %> <%= rs("LastName").Value %><%
Set rs2 = cn.Execute("SELECT * FROM Table2")
If Not rs2.EOF Then
rs2.MoveFirst
While Not rs2.EOF
%><%= rs("FirstName").Value %> <%= rs("LastName").Value %>
<%
<%= rs2("Address").Value %><%
Wend 'Not rs2.EOF
End If 'Not rs2.EOF
rs.Close
Set rs = Nothing
rs2.Close
Set rs2 = Nothing

2007-03-27 05:15:22 · answer #2 · answered by Art Student 2 · 0 0

fedest.com, questions and answers