PC Review


Reply
Thread Tools Rate Thread

ADO read to and array

 
 
Deke
Guest
Posts: n/a
 
      24th Jun 2008
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...
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      24th Jun 2008

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" <(E-Mail Removed)> wrote in message
news:A14135A7-88B6-4A2E-BC20-(E-Mail Removed)...
>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...



 
Reply With Quote
 
Deke
Guest
Posts: n/a
 
      24th Jun 2008
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" <(E-Mail Removed)> wrote in message
> news:A14135A7-88B6-4A2E-BC20-(E-Mail Removed)...
> >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...

>
>
>

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      24th Jun 2008
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" <(E-Mail Removed)> wrote in message
news:5F031AE3-0002-487F-B6CD-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:A14135A7-88B6-4A2E-BC20-(E-Mail Removed)...
>> >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...

>>
>>
>>



 
Reply With Quote
 
Alan Beban
Guest
Posts: n/a
 
      24th Jun 2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Read csv to 2D array Dave Microsoft Excel Programming 2 23rd Oct 2008 06:54 AM
HOW TO READ ARRAY OF STRUCTURES FROM COM using C# srinivas Microsoft Dot NET 0 3rd Jul 2006 12:24 PM
read array into a table =?Utf-8?B?U291bmRHdXk=?= Microsoft Access VBA Modules 2 24th Nov 2004 05:48 PM
Read in Array =?Utf-8?B?TGVpZ2g=?= Microsoft Excel Programming 1 5th May 2004 09:18 AM
How do you read an Array? Doug Microsoft C# .NET 1 15th Dec 2003 09:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:36 AM.