Hi there i have a problem that i need to be able to define a number of variables based on a database information, so obviously i can't just define these in the code, i need some way of looping over the database results and to create the variable and recordset at runtime. I want to be able to loop over objLocations and create a variable and recordset for all of the records returned by objLocations
strLocations ="Select * from tblLocations"
objLocations.Open strLocations
while not objLocations.EOF
define new_vbl 'dynamically created
define recordset_vbl 'dynamically created
Set recordset_vbl=Server.CreateObject("ADODB.Recordset"
Set recordset_vbl.ActiveConnection = objConn
new_vbl = "SELECT * from table1, table2 WHERE LocationID=" & objLocations("LocationID"
recordset_vbl.Open new_vbl
wend
does anyone have any ideas of how i can achieve this?
strLocations ="Select * from tblLocations"
objLocations.Open strLocations
while not objLocations.EOF
define new_vbl 'dynamically created
define recordset_vbl 'dynamically created
Set recordset_vbl=Server.CreateObject("ADODB.Recordset"
Set recordset_vbl.ActiveConnection = objConn
new_vbl = "SELECT * from table1, table2 WHERE LocationID=" & objLocations("LocationID"
recordset_vbl.Open new_vbl
wend
does anyone have any ideas of how i can achieve this?