Multi-dimensional Array

Results 1 to 3 of 3

Thread: Multi-dimensional Array

  1. #1
    Corin Guest

    Default Multi-dimensional Array

    I need help creating a multi-dimensional array and then filling it with values from a database. I can create the db connection and fill the RecordSet but I&#039m having problems creating the multi-dimensional array and then filling it with FOR loops.<BR><BR>Any help would be highly appreciated

  2. #2
    Join Date
    Dec 1969

    Default RE: Multi-dimensional Array

    multi dimensional arrays are not VB friendly<BR>4 guys has good info on this stuff<BR><BR>or check out the &#039dictionary object&#039<BR><BR>it can make life a lot easier

  3. #3
    Bill Stride Guest

    Default RE: Multi-dimensional Array

    Can you post some code that you are trying to use?<BR><BR>You should be able to do something like:<BR><BR>icount = 0<BR>while not adors.eof<BR> if icount = 0 then<BR> redim arrVals(3, icount)<BR> else<BR> redim preserve arrVals(3, icount)<BR> end if<BR><BR> arrVals(0, icount) = adors("val0")<BR> arrVals(1, icount) = adors("val1")<BR> arrVals(2, icount) = adors("val2")<BR> arrVals(3, icount) = adors("val3")<BR><BR> icount = icount + 1<BR><BR> adors.movenext<BR><BR>wend<BR><BR>The array is stored as (col, row). I believe in the MDAC 2.5 release, via ADO you should also be able to say arrVals = adors.getrows (have to verify that). That should return a multi dimension array for you also.<BR><BR>Cheers,<BR><BR>Bill<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts