Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Table to 2.dimensional Array

Posted on 2000-03-06
5
Medium Priority
?
150 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 300 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

916 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