Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default return multiple results from stored proc

hi

i have a stored proc with multiple select statements in it.
How can i successfully get these results into excel spreadsheet using
ADODB
I have tried

sql = "exec sp_proc "
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
con.Open "DSN=" & DSN & ";Database=" & DB & ";UID=" _
& User & ";PWD=" & Password

rs.Open sql, con

but after that i am stuck. thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default return multiple results from stored proc


once the recordset is populated

use excel's CopyFromRecordset method

note: I would avoid the DSN approach
users without the DSN will not be able to run your code.

define the connection in your connectstring.
many examples on:
http://www.carlprothman.net/Default.aspx?tabid=81



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


wrote :

hi

i have a stored proc with multiple select statements in it.
How can i successfully get these results into excel spreadsheet using
ADODB
I have tried

sql = "exec sp_proc "
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
con.Open "DSN=" & DSN & ";Database=" & DB & ";UID=" _
& User & ";PWD=" & Password

rs.Open sql, con

but after that i am stuck. thanks

Reply
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Match / Index multiple criteria return multiple results Marty Excel Worksheet Functions 2 May 22nd 10 01:49 PM
How to return multiple results in a cell Vinod[_2_] Excel Discussion (Misc queries) 5 May 28th 08 06:34 AM
how to return multiple results in vlookup? Landa Excel Worksheet Functions 3 July 20th 06 08:27 AM
execte stored proc maxzsim Excel Programming 1 May 10th 05 05:50 PM
Return Multiple Results with Lookup Josh O. Excel Worksheet Functions 1 February 4th 05 08:07 PM


All times are GMT +1. The time now is 06:49 AM.

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

About Us

"It's about Microsoft Excel"