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

asp - sql - newbie question

Status
Not open for further replies.

sezme

Programmer
Oct 31, 2003
26
0
0
GB

i have created a recordset called rs

now i would like to use a value returned from this recordset to create another recordset

sql = "Select * from table where lID = "& rs("lID")

my question is this.

is this the right way to do this ? will i come across problems later on by creating a second recordset - the code I have written works - but i want to know what other people do.

thanks

sez
 
You can create as many recordsets to the permitted amount.

sql =" select id from idtable where id ="&rs("id")
set rs2 = conn.execute(sql)
sql =" select id from idtable where id ="&rs2("id")
set rs3 = conn.execute(sql)
sql =" select id from idtable where id ="&rs3("id")
set rs4 = conn.execute(sql)
sql =" select id from idtable where id ="&rs4("id")
.....
I like to cast
sql =" select id from idtable where id ="&CInt(rs("id"))
set rs2 = conn.execute(sql)
sql =" select id from idtable where id ="&CInt(rs2("id"))
set rs3 = conn.execute(sql)
sql =" select id from idtable where id ="&CInt(rs3("id"))
set rs4 = conn.execute(sql)
sql =" select id from idtable where id ="&CInt(rs4("id"))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top