View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Martin Eckart Martin Eckart is offline
external usenet poster
 
Posts: 3
Default Importing Data from a Stored Procedure (SQL SErver)

Hi there,

I am trying to import data from a Stored procedure which has a Select
Statement in it into Excel.
I could also exec the select Statement out of Excel (VBA), that would be ok
for me also.

I am struggling in setting up the Connection and the Recordset Objects and
then call the CopyfromRecordset method.

For example:
I have in my code:
Dim cnPubs As ADODB.Connection
Set cnPubs = New ADODB.Connection

and I get the following Error while running the Macro: Compile Error:
User-Defined type not defined

I have to admit that I am not that good in ADODB Connection building and
Recordset operations...

I would appreciate your help big time.

Thanks,
Martin