Solved

Table to 2.dimensional Array

Posted on 2000-03-06
5
142 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Run code from text file in vb 1 103
VB6 common control 6 sp6 object library not registerd 3 65
Macro problems with Excel file 6 52
Userform to show a range in excel. 3 33
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

739 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