SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2013
    0 Post(s)
    0 Thread(s)

    ASP retrieving data from recordset array.

    I'm having some trouble with the following:

    My Main array has been set up earlier in the code by

    Code ASP:
    arrSignType = rsFindSign.GetRows(,,Array("SignID",..."SignSize", "SignSort" ))

    All these columns match from the DB (having been copied and pasted a dozen times from the SQL.) Now I try to use the data from this array...

    Code ASP:
    <select name="size" id="size" onchange="javascript:getSignPrice();">
                    <option value="<%=pSize %>"><%=pSize%></option>

    (This option shown above I assigned earlier and works ok. It is only for test and is to be removed.)

    Code ASP:
                    DIM tempArray(0)
                    Dim j, found, sizeValue
                    For i = 0 to UBound(arrSignType,2)
                        pSize = arrSignType(7,i)
                        sizeValue = ""
                        found = false
                                select case trim(LCase(pSize)) 
                                    case "large"
                                        sizeValue = "L"
                                    case "small"
                                        sizeValue = "S"
                                    case "medium"
                                        sizeValue = "M"
                                end select
                        For j = 0 to UBound(tempArray)
                            if tempArray(j) = pSize then
                                found = true
                            end if
                        if not found then
                            redim preserve tempArray(UBound(tempArray) + 1)
                            tempArray(UBound(tempArray)) = pSize
                            response.write (VbCrLf & "<option value=""" & sizeValue & """>" & pSize & "</option>")
                        end if
                size |<%=arrSignType(7,0)%>| found.

    If I print out the UBOUND(arrSignType,2) it reads that 29 entries are present. The above string arrSignType(7,0) prints out as "".

    This is probably something really silly I'm overlooking but I can't for seem to work it out. Been coming back to this for a couple of days now!!

    Any help would be gratefully appreciated.

    Cheers in advance Jas.

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2011
    OH, USA
    0 Post(s)
    0 Thread(s)
    what value return UBOUND(arrSignType,1) ?


Posting Permissions

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