recordset results show in excel - TechRepublic
Question
December 1, 2008 at 07:34 PM
gener.santos

recordset results show in excel

by gener.santos . Updated 17 years, 7 months ago

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

This discussion is locked

All Comments