Recordset to 2D Array Question

From: violetaria (terri.calderone_at_gmail.com)
Date: 12/08/04


Date: 8 Dec 2004 10:55:08 -0800

I'm trying to find the fastest way to get a recordset into a 2D array
in JScript. I need to handle recordset with at least 10,000 entries in
a reasonable about of time. Currently my code looks like this:

rs1.open(sql,conn,3,3);
if (!rs1.EOF)
{
var strData = rs1.GetString(2,-1,",",";","");
var rowsArray = strData.split(";");
var finalArray = new Array();
var counter=0;
for(i=0;i<rowsArray.length;i++)
{
finalArray[counter++] = rowsArray[i].split(",");
}
rs1.close();
}

This is extremely slow and I need to find a better way to do this. I
don't think a loop with moveNext() will be any better. Does anyone
have any suggestions?
Thanks!



Relevant Pages

  • Re: Recordset to 2D Array Question
    ... Instead of toArray you could use the VBArray getItem ... var rs = Conn.Execute; ... I'm trying to find the fastest way to get a recordset into a 2D array ...
    (microsoft.public.scripting.jscript)
  • Re: TrySetLength not possible !? :(
    ... The length of the array is supposed to be the number of elements. ... function SkybuckTrySetLength(var ParaVar; const ParaNewLength: ... vWord: array of Word; ... vLongword: array of Longword; ...
    (alt.comp.lang.borland-delphi)
  • (patch for Bash) regex case statement
    ... Following up on my previous patch for regex conditional tests, ... /* Return an array of strings; ... int dollarflag, zeropad, compareflag; ... SHELL_VAR *var; ...
    (comp.unix.shell)
  • Re: Updated datestamp doesnt work
    ... Public Sub StoreOldVals ... ' store values of current row in array ... Dim n As Integer, intlast As Integer ... Dim var As Variant ...
    (microsoft.public.access.gettingstarted)
  • Re: Updated datestamp doesnt work
    ... Public Sub StoreOldVals ... ' store values of current row in array ... Dim n As Integer, intlast As Integer ... Dim var As Variant ...
    (microsoft.public.access.gettingstarted)