N
news.cablevision.qc.ca
Hi!
I want, using a form, enter a number and then, read that number of records
in a database and store information in variables. The only way I see to do
this is to do a FOR...NEXT to the number entered in the form, and then
include the database reading into it.
THE PROBLEM:
<%
for x = 1 to [Selected Number]
mySQL = "SELECT * FROM table "
set ObjectRecordset=ObjetConnection.execute(mySQL)
FieldValue = ObjectRecordset.fields("field")
next
%>
With this example, let's say the [Selected Number] is 3, the script will
read the first 3 lines but the variable FieldValue will be overwritten at
each pass of the FOR...NEXT...
So, I would need to use FieldValue1, FieldValue2, FieldValue3. As the
number entered can be anything, I cannot use static variables. I would need
to use the variable FieldValue followed by the value of x...
FieldValue[x]
Then the result should be FieldValue1, FieldValue2, etc... until the number
entered is reached.
Is anybody can give me the way to do this?
Thanks!!!
Andrew
I want, using a form, enter a number and then, read that number of records
in a database and store information in variables. The only way I see to do
this is to do a FOR...NEXT to the number entered in the form, and then
include the database reading into it.
THE PROBLEM:
<%
for x = 1 to [Selected Number]
mySQL = "SELECT * FROM table "
set ObjectRecordset=ObjetConnection.execute(mySQL)
FieldValue = ObjectRecordset.fields("field")
next
%>
With this example, let's say the [Selected Number] is 3, the script will
read the first 3 lines but the variable FieldValue will be overwritten at
each pass of the FOR...NEXT...
So, I would need to use FieldValue1, FieldValue2, FieldValue3. As the
number entered can be anything, I cannot use static variables. I would need
to use the variable FieldValue followed by the value of x...
FieldValue[x]
Then the result should be FieldValue1, FieldValue2, etc... until the number
entered is reached.
Is anybody can give me the way to do this?
Thanks!!!
Andrew