Eric Layman wrote:
Hi,
I have the following script below.
I intend to have a dynamic array of non fixed size
set rsseats = conn.execute("select * from seats")
http://www.aspfaq.com/show.asp?id=2096
Dim arr(1)
response.write ubound(arr)
do while not rsseats.eof
ReDim arr(ubound(arr)+1)
rsseats.movenext
loop
set rsseats = nothing
But i will get hit with "The array is fixed or temp locked"
how should i fix that
Actually, you are going to too much trouble. Use GetRows to create an
array from your recordset:
if not rsseats.eof then arr=rsseats.getrows
This will create a 2-dimensional array of the recordset data: the first
dimension refers to the field and the second to the row. So to look at
the second field of the third row, you would do this:
arr(1,2)
You can specify which field to extract if you only want to extract a
single field (however, in this case, why retrieve ALL the fields when
only interested on one?)
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.