By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,107 Members | 1,607 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,107 IT Pros & Developers. It's quick & easy.

classic asp: "This array is fixed or temporarily locked "

P: n/a

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")
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

Please advise.

Thanks

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Feb 5 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Eric Layman" <namyalcire[at no spam]gmail.comwrote in message
news:11*************@sp6iad.superfeed.net...
>
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")
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

Please advise.

Thanks
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
I've got it.

set rsseats = conn.execute("select * from seats")
Dim arr()
intsize = 0
do while not rsseats.eof
ReDim preserve arr(intsize)
arr(intsize) ="my data"
intsize = intsize + 1
rsseats.movenext
loop
set rsseats = nothing

Thanks.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Feb 5 '07 #2

P: n/a
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.
Feb 5 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.