If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > how to pull the recordset to a array?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-23-03, 11:09
cindymandy cindymandy is offline
Registered User
 
Join Date: Oct 2003
Posts: 3
Lightbulb how to pull the recordset to a array?

Hi,

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
rsTemp.Close
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?

Thanks
Reply With Quote
  #2 (permalink)  
Old 10-23-03, 12:10
cindymandy cindymandy is offline
Registered User
 
Join Date: Oct 2003
Posts: 3
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")
Reply With Quote
  #3 (permalink)  
Old 10-24-03, 06:59
rhs98 rhs98 is offline
Super Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 441
Thanks for the info...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On