|
 |
asp_databases thread: ASP using Javascript
Message #1 by "Siber Wulf" <sibrwulf@h...> on Wed, 20 Jun 2001 22:20:49 -0500
|
|
Two questions really (newbie post, just point my ignorant booty in the
right direction):
Does anyone really use Javascript for ASP anymore? I'm a C programmer,
and its MUCH easier than trying to decrypt this "basic"
How about arrays? They seem a bit...backassward. how do you declare an
empty array with a defined size, and why do i get this problem?
Code:
for (i =3D 0; i < MAX_ARRAY_SIZE && !array_list.eof; i++)
{
temp =3D array_list("Product_num");
if (!temp)
break;
index_of_products[i] =3D temp;
array_list.moveNext();
}
Just loads the product numbers into an array. When it gets to the '0'
at the end, it just breaks outta the for loop. Also if it hits eof or
the max size, it breaks out.
This part of the code is fine. Works like a charm. I put a
Response.Write(index_of_products[i]); in there, and it worked fine.
now.
I set a more logical varible after this loop:
products_in_index =3D i;
no big whoop. Its the right number
Now here's the issue:
for (i =3D 1; i < products_in_index; i++)
{
Response.Write("<br>");
Response.Write(index_of_products[i]); //*********
}
I get a:
Error Type:
ADODB.Field (0x80020009)
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record.
/projects/philip/test-js.asp, line 47
(line 47 is the starrted line)
Any help you guys can give is mucho appreciated.
Thanks in advance!
Rob
Message #2 by "Blake, Shane" <Shane.Blake@p...> on Thu, 21 Jun 2001 11:12:26 -0400
|
|
i use jscript to do all my asp coding...
not exactly sure what you're trying to do in the code you've
provided...
is array_list your recordset?
if you're using ADO's .getRows() you have to use the jscript VBArray
object
and methods...
maybe you could post more code...
shane blake
raliegh, nc
-----Original Message-----
From: Siber Wulf [mailto:sibrwulf@h...]
Sent: Wednesday, June 20, 2001 11:21 PM
To: ASP Databases
Subject: [asp_databases] ASP using Javascript
Two questions really (newbie post, just point my ignorant booty in the
right
direction):
Does anyone really use Javascript for ASP anymore? I'm a C programmer,
and
its MUCH easier than trying to decrypt this "basic"
How about arrays? They seem a bit...backassward. how do you declare
an
empty array with a defined size, and why do i get this problem?
Code:
for (i =3D 0; i < MAX_ARRAY_SIZE && !array_list.eof; i++)
{
temp =3D array_list("Product_num");
if (!temp)
break;
index_of_products[i] =3D temp;
array_list.moveNext();
}
Just loads the product numbers into an array. When it gets to the '0'
at
the end, it just breaks outta the for loop. Also if it hits eof or the
max
size, it breaks out.
This part of the code is fine. Works like a charm. I put a
Response.Write(index_of_products[i]); in there, and it worked fine.
now.
I set a more logical varible after this loop:
products_in_index =3D i;
no big whoop. Its the right number
Now here's the issue:
for (i =3D 1; i < products_in_index; i++)
{
Response.Write("<br>");
Response.Write(index_of_products[i]); //*********
}
I get a:
Error Type:
ADODB.Field (0x80020009)
Either BOF or EOF is True, or the current record has been deleted.
Requested
operation requires a current record.
/projects/philip/test-js.asp, line 47
(line 47 is the starrted line)
Any help you guys can give is mucho appreciated.
Thanks in advance!
Rob
|
|
 |