ASP do until loop

Associate
Joined
21 Feb 2004
Posts
886
HI, in the following code i want to acheive to have multiple variables with corrisponding numbers. for example

Code:
dim connections

connections = 0
Do Until connections = 10

dim blah+(connections)

connections = (connections + 1)
Loop

so i will have 10 variables named blah1-10. I just cant quite figure out how to add on the number.

I only want this for serverside use, not response.write.

Thank you
 
Soldato
Joined
18 Oct 2002
Posts
15,200
Location
The land of milk & beans
in ASP the names of variables cannot be evaluated as code, they must be plain text, so you'd have to define dim a1, a2 rather than say dim 'a' & i + 1.

The best way to do what you're after would be have an array and fill it in your loop

Code:
dim arrArray(10), iConnections

iConnections = 0
do while iConnections <= 10
  arrArray(i) = szWhatever

  iConnections = iConnections + 1
loop
 
Last edited:
Associate
OP
Joined
21 Feb 2004
Posts
886
oh right thanks.

What i really want to do is i have a record set which brings back multiple rows and from those rows it brings back i want to insert each record into another table. How is this possible? ive been looking at some ado methods but struggling on how to use them.

i am using MYsql as dbobject.

Thank you
 
Back
Top Bottom