Arrays and String

Results 1 to 2 of 2

Thread: Arrays and String

  1. #1
    Join Date
    Dec 1969

    Default Arrays and String

    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&#039;t the size of the array, so I am trying to use a loop but at I get is "subscript out of range"<BR><BR>Thank you for your time<BR><BR>&#060;%<BR> Dim Connect, RS, Query, full_total, clientid, itemid, Nearlyprice, Newprice<BR> clientid = Request.Cookies("user")<BR> Set Connect = Server.CreateObject("ADODB.Connection")<BR> Connect.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=D:stagingasketdbjigsawbasket.mdb"<BR> Connect.Open <BR> Set RS = Server.CreateObject("ADODB.Recordset")<BR> Query = "SELECT * FROM basket WHERE Clientid =&#039;"& clientid & "&#039; "<BR> RS.Open Query, Connect<BR><BR><BR>Dim itemArray, longdescArray, priceArray, qtyArray, StrItem, Strlongdesc, StrPrice, StrQty<BR>qtyArray = Array()<BR>priceArray = Array()<BR>longdescArray = Array()<BR>itemArray = Array()<BR>i=1<BR>Do While Not RS.EOF<BR>itemArray(i) = RS("Itemid")<BR>longdescArray(i) = RS("longdesc")<BR>priceArray(i) = Replace(RS("price"), "."," ")<BR>qtyArray(i) = RS("qty")<BR>RS.MoveNext<BR> i = i + 1<BR> Loop<BR>StrItem = Join(itemArray,",")<BR>Strlongdesc = Join(longdescArray,",")<BR>Strprice = Join(priceArray,",")<BR>StrQty = Join(qtyArray,",")<BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default Why not just pass..

    .. the ClientID to the next page and query the database there?<BR><BR>That, or use the Recordset method, GetRows() and store the array in a Session variable?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts