[thelist] asp array into variables

Paul Cowan evolt at funkwit.com
Wed Aug 13 15:41:44 CDT 2003

Tab Alleman wrote:
>> You're saying 'the second column (index 1) of row i'. Row i (initially
>> 0, the first row) doesn't HAVE a second column... just the one.
> Noooooooooooooo.... GetRows always returns a 2d array.

Yep. But when you do
	tbValues = RsHomepage.GetRows(, , Array("Image"))
the last argument means that you're only getting one column out -- "Image".

It's 2-dimensional, all right, but one of the dimensions has a ubound
of 0. The "ImgSrc1 = tbValues(1, i)" line will fail, regardless of the
results of the DB call.

> Cause Ubound returns the number of items in that dimension of the array,
> but the actual array index is 0-based.  If you do:
> Dim AnArray(4)
> Then Ubound(AnArray) will equal 4, but you can only populate AnArray(0)
> thru AnArray(3).

The first part's right; the second is wrong. You can fill array items
0 through 4. Dim AnArray(4) will dim a *5*-element array.

Try it if you like! ;)


More information about the thelist mailing list