Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array - Client side VBscript maybe?

Status
Not open for further replies.

TheJFM

Programmer
Jun 13, 2002
65
GB
Through ASP I run a SQL query that should populate a table.

The recordset is over 29000 rows so obviously populating the table is not practical.

I need to generate a Client side multi dimensional array containing all the 290000 rows and allow the client to select his range.

How do I populate the array in VBscript ( I understand that Javascript will not support a multi dimensiona array).

Your help would be appreciate since I am now pulling my hair out with this.


 
Aaaah!
Firstly, I would not display 290,000 rows to a client. If I were you I would create a search tool to dramatically shorten the number of results. What you will want to look into after that is something called paging (your database can support it) which will allow you to specify that you want to receive X records at a time from the database. This way you can show the user 10 or 20 records at a time and give them some navigation buttons to see the rest, you cut down on server load, your communications to the database server will be faster, etc
I doubt any customer needs 290,000 records displayed at any split second in time. I would highly highly highly recommend you create a search and use paging.
Just my thoughts.
-Tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Thanks

I am not familiar with paging in SQL server. I'll have a think about this.

In any case I am working on narrowing search parameters to reduce the number of returned rows.

Nonetheless I do need to find a way of retuning a multi dimension array Client side
 
It isn't necessarally impossible to do with javascript, just a royal pain. VBScript ought to be able to handle it, but I can't promise. I'll show you how it's done normally.

Code:
'declaration
Dim myArray(3,5)

'sample assignment
myArray(0,0) = "0 0 value"
myArray(0,1) = "0 1 value"
myArray(0,2) = "0 2 value"
myArray(0,3) = "0 3 value"
myArray(0,4) = "0 4 value"

myArray(1,0) = "1 0 value"
myArray(1,1) = "1 1 value"
myArray(1,2) = "1 2 value"
myArray(1,3) = "1 3 value"
myArray(1,4) = "1 4 value"

myArray(2,0) = "2 0 value"
myArray(2,1) = "2 1 value"
myArray(2,2) = "2 2 value"
myArray(2,3) = "2 3 value"
myArray(2,4) = "2 4 value"
you can actually assign values from myArray(0,0) to myArray(2,5). This is differant from most languages. Most languages you are specifying the size of the array when you declare it, in VB you are specifying the upper bounds of the array starting with index 0. This means your actual dimensions will alway be 1 greater than the number you declared.
-Tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top