Can some one please help, what I am trying to do is extract the data from a Access database and return these variable in to a array, so I can then join them up and pass them to the next page as strings. The problem is that it is not a set number of records so I don't the size of the array, so I am trying to use a loop but at I get is "subscript out of range"
Thank you for your time
<%
Dim Connect, RS, Query, full_total, clientid, itemid, Nearlyprice, Newprice
clientid = Request.Cookies("user"
Set Connect = Server.CreateObject("ADODB.Connection"
Connect.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=D:\staging\basketdb\jigsawbasket.mdb"
Connect.Open
Set RS = Server.CreateObject("ADODB.Recordset"
Query = "SELECT * FROM basket WHERE Clientid ='"& clientid & "' "
RS.Open Query, Connect
Dim itemArray, longdescArray, priceArray, qtyArray, StrItem, Strlongdesc, StrPrice, StrQty
qtyArray = Array()
priceArray = Array()
longdescArray = Array()
itemArray = Array()
i=1
Do While Not RS.EOF
itemArray(i) = RS("Itemid"
longdescArray(i) = RS("longdesc"
priceArray(i) = Replace(RS("price", "."," "
qtyArray(i) = RS("qty"
RS.MoveNext
i = i + 1
Loop
StrItem = Join(itemArray,","
Strlongdesc = Join(longdescArray,","
Strprice = Join(priceArray,","
StrQty = Join(qtyArray,","
%>
Thank you for your time
<%
Dim Connect, RS, Query, full_total, clientid, itemid, Nearlyprice, Newprice
clientid = Request.Cookies("user"
Set Connect = Server.CreateObject("ADODB.Connection"
Connect.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=D:\staging\basketdb\jigsawbasket.mdb"
Connect.Open
Set RS = Server.CreateObject("ADODB.Recordset"
Query = "SELECT * FROM basket WHERE Clientid ='"& clientid & "' "
RS.Open Query, Connect
Dim itemArray, longdescArray, priceArray, qtyArray, StrItem, Strlongdesc, StrPrice, StrQty
qtyArray = Array()
priceArray = Array()
longdescArray = Array()
itemArray = Array()
i=1
Do While Not RS.EOF
itemArray(i) = RS("Itemid"
longdescArray(i) = RS("longdesc"
priceArray(i) = Replace(RS("price", "."," "
qtyArray(i) = RS("qty"
RS.MoveNext
i = i + 1
Loop
StrItem = Join(itemArray,","
Strlongdesc = Join(longdescArray,","
Strprice = Join(priceArray,","
StrQty = Join(qtyArray,","
%>