dave doyle
asked on
convert array into single variable string classic asp
I have a looping array that outputs all necessary data from table . I need to take that looped array and output it in a single string that I can use later in some other code .
Thanks in advance
Set Products_cmd = Server.CreateObject ("ADODB.Command")
Products_cmd.ActiveConnection = dbHistory
Products_cmd.CommandText = "SELECT * FROM organic WHERE isActive=0"
Products_cmd.Prepared = true
Set Products = Products_cmd.Execute
Dim arrProducts
arrProducts = Products.GetRows()
dim i
For i = 0 to ubound(arrProducts, 2)
response.write( trim(arrProducts(1,i))+"," )
next
myNewVar_organic=???
Thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The idea of using getrows allows you to use your arrProducts variable throughout the page without ever having to go back to the database. Depending on what you are trying to do, you may be fine not taking the arrProducts and putting it to another variable.
ASKER
Perfect, many thanks!