LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel & MS Sql

Hi Jamie,

Thanks for correcting me (grrr!).

Seriously, I keep saying that about Recordset, and keep getting corrected.
One day ...

That last bit was meant to be an either or, giving the OP a choice. I
wouldn't use both personally, so there would be no need for the MoveFirst
(see I have an answer for everything <vbg).

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"onedaywhen" wrote in message
om...
"Bob Phillips" wrote ...

You should set a reference to the ActiveX Data Objects and
ActiveX Data Objects Recordset libraries


Bob,
All that's required is the reference to Microsoft ActiveX Data Objects
(ADODB). The reference to Microsoft ActiveX Data Objects Recordset
(ADOR) isn't required if you fully declare your Recordset object as
ADODB.Recordset.

From MSDN, ADOR is:

"A lightweight version of ADO that contains only the
functionality of the ADO Recordset object. This version
of ADO is typically used only from script in a Web page
to minimize memory requirements."

Aside: I noticed your lines (typo corrected)

Range("A2").CopyFromRecordset oRS
myArray = oRS.GetRows()

will cause a run-time error on the second line because
CopyFromRecordset has caused EOF. You need e.g.

oRS.MoveFirst

between the two.

Jamie.

--



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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



All times are GMT +1. The time now is 04:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"