![]() |
ADO read to and array
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. -- Cheers... |
ADO read to and array
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) "Deke" wrote in message ... 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. -- Cheers... |
ADO read to and array
Thanks, I works great, but for some reason it puts into a multi-dimensional
array... -- Cheers... "Bob Phillips" wrote: 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) "Deke" wrote in message ... 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. -- Cheers... |
ADO read to and 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" wrote in message ... Thanks, I works great, but for some reason it puts into a multi-dimensional array... -- Cheers... "Bob Phillips" wrote: 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) "Deke" wrote in message ... 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. -- Cheers... |
ADO read to and array
Deke wrote:
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 |
All times are GMT +1. The time now is 12:23 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com