Solved

Table to 2.dimensional Array

Posted on 2000-03-06
5
136 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
Comment Utility
'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
Comment Utility
Dim avarData() as Variant, numrecords as Long
avarData = dynMan.GetRows
numrecords = UBound(avarData, 2) + 1
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
The GetRows method is fastest than For loops!!!
0
 

Author Comment

by:Taras
Comment Utility
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
Comment Utility
yes u r correct, place move next after next col. sorry for the mistake.

hth
alok.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now