Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_discuss thread: Array Problem in Assigning Values


Message #1 by "Dibyendra Hyoju" <dibyendra@y...> on Wed, 30 Oct 2002 01:35:20
<% 
dim path,conn,rs,mySQL
path="provider=microsoft.Jet.OLEDB.4.0;Data Source=" &Server.Mappath 
("..\db\transaction.mdb")
set conn=server.createobject("adodb.connection")
set rs = Server.CreateObject("ADODB.Recordset")
'conn.open session("connection_string")
conn.open path
mySQL="select * from customers order by CustomerID"
set rs = conn.execute(mySQL)
%>

<%
dim arr()
dim i
recCount=rs.RecordCount
redim preserve arr(recCount)
do while not rs.eof
arr(i)=rs("CustomerID")
response.wrire arr(i)
i=i+1
Loop
%>

The Above Code Gave Subscript out of range: '' ERROR
I couldn't figure out what's wrong with the code.
Is this assigning  mehtod wrong?
Then,how can i assign the each recorset value to the array usin loop?
Please Help!
Dibyendra

  Return to Index