Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Excel 2007 AND Retrieving Data from Stored Procedure on SQL Exp 20

Currently have some code that when I pass through a select * on a dbo.tbl it
the code retrieves all the table data and places back on sheet1. When I pass
through the stored procedure, it retrieves nothing back. If we run the
stored procedure which is a select of 5 tables, it retrieves the data back.

Any ideas or assistance would be great. See code below.

Sub GetData()

Dim c As ADODB.Connection
Dim rsPubs As ADODB.Recordset

Set c = New ADODB.Connection
Set rsPubs = New ADODB.Recordset

c.Open "DSN=Portfolio"

With rsPubs
.ActiveConnection = c


rsPubs.Open "dbo.sp_getstaffinventory"

Sheet1.Range("A1").CopyFromRecordset rsPubs

.Close

End With

c.Close
Set c = Nothing

End Sub
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
Excel Connection to SQL 2007 can't find stored procedure message SaveTheMonarchButterflies Excel Discussion (Misc queries) 0 November 10th 08 03:58 PM
Data return from SQL Stored procedure... Jonathon Shull Excel Discussion (Misc queries) 0 July 29th 08 04:25 PM
HELP No return data from my stored procedure RocketMan[_2_] Excel Programming 1 June 6th 07 06:52 PM
Extract data from Stored procedure anu_manu Excel Discussion (Misc queries) 0 February 15th 06 02:49 PM
Importing Data from a Stored Procedure (SQL SErver) Martin Eckart Excel Programming 1 January 22nd 04 01:24 AM


All times are GMT +1. The time now is 12:08 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"