Excel & MS Sql
"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.
--
|