Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003

    Lightbulb Unanswered: how to pull the recordset to a array?


    I'm trying to get a record into an Array like this :

    Function GetItemParameters(iItemID)
    Dim aParameters
    rsTemp.Open "Select * From list Where pid = " & iItemID
    If Not rsTemp.EOF Then
    aParameters = Array(rsTemp("productThumbnail"), rsTemp("productName"), rsTemp("productPrice"))

    GetItemParameters = aParameters
    End If
    End Function

    When i call it example like this aParameters(1) I get
    Type mismatch: 'aParameters'

    I think it's syntax error cause if I have
    aParameters = Array("1","2","3")
    It would work okay.

    I think it's because I'm missing the quotation mark around rsTemp("value"), but if I add the quote around it, the program would not understand that it is a value and not text. What should be the right syntax be?


  2. #2
    Join Date
    Oct 2003

    Re: how to pull the recordset to a array?

    Nevermind. It wasn't working because the recordset was emtpy. But the array syntax didn't work either. I had to use.

    aParameters(1) = rsTemp("productThumbnail")
    aParameters(2) = rsTemp("productName")
    aParameters(3) = rsTemp("productPrice")

  3. #3
    Join Date
    Feb 2002
    San Francisco, CA
    Thanks for the info...

Posting Permissions

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