I have a piece of code where I loop through a recordset and would like to set the value of a variable, like "selimagefile1". However, my variables increase by one, selimagefile1, selimagefile2 and so forth. So, how do I set the variables if my code looks like this and will not compile correctly....
Thanks,
Todd
Code:
'Get data from ANN_SCHEDULE_IMAGE
'
Set cn = GetDBConnection()
Set SQLStmt1 = Server.CreateObject("ADODB.Command")
Set RS1 = Server.CreateObject("ADODB.Recordset")
SQLStmt1.CommandText = "SELECT * FROM ANN_SCHEDULE_IMAGE " & _
" WHERE ANN_SCHEDULE_ID = '" & ann_schedule_id & "'"
SQLStmt1.CommandType = 1
Set SQLStmt1.ActiveConnection = cn
RS1.Open SQLStmt1
count1 = 1
Do While Not RS1.EOF
"selimagefile" & count1 = RS1("image_name") 'error here
"selcaption" & count1 = RS1("image_caption") 'error here
count1 = count1 + 1
RS1.MoveNext
Loop
RS1.Close
Thanks,
Todd