+ Reply to Thread
Results 1 to 2 of 2

return multiple results from stored proc

  1. #1

    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. #2
    keepITcool
    Guest

    Re: 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


    [email protected] 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1