[thelist] ASP Loop Question

Feingold Josh S Josh.S.Feingold at irs.gov
Wed Mar 20 09:32:09 CST 2002


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
I have 10 variables:

variable_1 = "string1"
variable_2 = "string2"
...
variable_10 = "string10"

I want to insert the variable data into a database as a separate row.  I
would also like to automate this process.

I tried:

for x = 1 to 10
    variable = "variable_" & x
    rs.Open "INSERT INTO database (column) VALUES (' " & variable & " ')"
next

The issue is that the string "variable_1" gets inserted in the database
instead of "string1."

Does anyone know what I am doing wrong?

Thanks,
Josh



More information about the thelist mailing list