Solved

Table to 2.dimensional Array

Posted on 2000-03-06
5
139 Views
Last Modified: 2010-05-02
I have access table 19 columns and 5950 rows. How I can put it in two dimensionl array. I am pulling data with recordset from database.
thanks
Taras
0
Comment
Question by:Taras
5 Comments
 
LVL 2

Accepted Solution

by:
alokanant earned 100 total points
ID: 2590373
'Assuming that you have already set rs

dim varArr(5950,19) as variant
dim row as integer
dim col as integer

rs.movefirst
for row = 0 to 5949
for col = 0 to 18
varArr(row,col) = rs.fields(col)
rs.movenext
next col
next row

hth
alok
0
 
LVL 15

Expert Comment

by:ameba
ID: 2590796
Dim avarData() as Variant, numrecords as Long
avarData = dynMan.GetRows
numrecords = UBound(avarData, 2) + 1
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2591642
The GetRows method is fastest than For loops!!!
0
 

Author Comment

by:Taras
ID: 2594108
I am not sure should I put rs.movenext after next col
like it has more sens for me?
Thanks lot.
                rs.movefirst
                for row = 0 to 5949
                 for col = 0 to 18
                 varArr(row,col) = rs.fields(col)
                 
                 next col
                 rs.movenext
                 next row
0
 
LVL 2

Expert Comment

by:alokanant
ID: 2594462
yes u r correct, place move next after next col. sorry for the mistake.

hth
alok.
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question