Question Locked

recordset results show in excel

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,
How can I put the results of a stored procedure in a recordset so I can put it in a excel sheet? Below is the code I am using:

Dim conn As ADODB.connection
Set conn = New ADODB.connection
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
conn.Open "PROVIDER=SQLOLEDB;DATA SOURCE=XSOURCE;INITIAL CATALOG=XCATALOG;INTEGRATED SECURITY=sspi;"
conn.Execute "exec MyProcedure '10/01/2008','10/31/2008'"

I need the result of the above to be displayed in a sheet (sheet101).

Thanks

1 reply

This discussion is closed to new replies.