ADO read to and array

  • Thread starter Thread starter Deke
  • Start date Start date
D

Deke

I am currently using the CopyfromRecordset function to copy data from an
Access database into Excel worksheets.

The only problem is that I now have a requirement to read the data directly
into an array rather than to a worksheet.

I thought I read something on the forum about this a couple of weeks ago,
but I cannot find it again, any help would be greatly appreciated.
 
If Not oRS.EOF Then
ary = oRS.getrows


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Thanks, I works great, but for some reason it puts into a multi-dimensional
array...
 
That is because the data is multi-dimensional, rows x columns

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Deke said:
Thanks, I works great, but for some reason it puts into a multi-dimensional
array...

If the functions in the freely downloadable file at
http://home.pacbell.net/beban are available to your workbook

ary = ArrayReshape(ary, 1, ArrayCount(ary)) will convert it to a 1-D array.

Alan Beban
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top