Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recordset and Array Problem

Status
Not open for further replies.

prgmrgirl

Programmer
Feb 12, 2004
119
US
Hey guys,

I have a recordset that I pull back from a database. I'd like to put this recordset into an array. Seems simple enough, right?

Code:
var cust = new Array()
var i=0

while (!rst.eof)
{
cust[i] =rst.fields("custName")
rst.movenext
i++
}

I keep getting the error that cust is not an object or doesn't exist which makes no sense since I have it declared var cust = new Array().

For some reason when I try to assign cust a value using the rst.fields(), it doesn't work.

To test, I put:
Code:
cust[0]="TEST"
and it worked fine.

Can anyone see what I am doing wrong?

Thanks for your help!
 
Oops, I should also say that I did a
Code:
document.write(rst.fields("custName"))
and that worked fine, so I know the rst has data in it, etc.
 
>cust =rst.fields("custName")
[tt]cust =rst.fields("custName")[red].value[/red][/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top