previewservices
asked on
Retrieving data from SQL through variables
Hi all,
I can't seem tp figure out this error message saying "Item cannot be found in the collection corresponding to the requested name or ordinal."
Normally i would use:
sData = sData & Chr(34) & "" & (rsGetData.Fields.Item("MY FIELDHERE" ).Value) & "" & Chr(34) & ","
But beucase all the fields are in an array which i am looping round, i am trying to do this:
sData = sData & Chr(34) & "" & (rsGetData.Fields.Item(myA rray(i)).V alue) & "" & Chr(34) & ","
But i am getting the error message "Item cannot be found in the collection corresponding to the requested name or ordinal.". I have checked each field and it is deffinatly in the select statement. There is no room for a typo as it is all from the database.
Anyone know how i can edit the below code to make it work? Not sure if i'm missing anything?
Thanks in advance!
I can't seem tp figure out this error message saying "Item cannot be found in the collection corresponding to the requested name or ordinal."
Normally i would use:
sData = sData & Chr(34) & "" & (rsGetData.Fields.Item("MY
But beucase all the fields are in an array which i am looping round, i am trying to do this:
sData = sData & Chr(34) & "" & (rsGetData.Fields.Item(myA
But i am getting the error message "Item cannot be found in the collection corresponding to the requested name or ordinal.". I have checked each field and it is deffinatly in the select statement. There is no room for a typo as it is all from the database.
Anyone know how i can edit the below code to make it work? Not sure if i'm missing anything?
Thanks in advance!
sData = sData & Chr(34) & "" & (rsGetData.Fields.Item(myArray(i)).Value) & "" & Chr(34) & ","
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sData = sData & Chr(34) & " (rsGetData.Fields.Item(" & myArray(i) & ").Value) & " & Chr(34) & ","
Open in new window