LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default sql stored procedure results in a recordset questions

When I run a stored procedure out of dataimport...new database query by
pasting in {call procname} in the sql code box, the results returned include
the field names from the select * procedure .

When I assign the results of the stored procedure to a recordset out of VBA
I encounter several issues:
The code I use to assign the results to the recordset is as follows:

Set runspcmd = New ADODB.Command
runspcmd.CommandText = procname
runspcmd.CommandType = adCmdStoredProc
' execute the command.
Set runspcmd.ActiveConnection = cnnct
Set recset = runspcmd.Execute

1) The field/column names from the procedure results are not included in
recset. Anyway I can get the names as well?

2) recordcount, and certain of the Move commands don;t work --(presumably
because of the implicit cursor type?).
Is there any way I can easily count how may records are in the recordset?

3) I know how to place the recordset on a worksheet using copyfromrecordset.
Can copyfromrecordset be used to assign the recordset to an array? (I am
trying to populate a multi-column list box with the data in recset) Any other
suggestions on how to easily do this?

Thanks for any help anyone can provide.
 
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
DAO recordset Call to SQL Stored Proc Datasort Excel Programming 0 December 1st 05 06:06 PM
ADO recordset problem with stored procedure [email protected] Excel Programming 1 September 30th 05 08:46 PM
Passing an array or recordset to a stored procedure Paul Robinson Excel Programming 1 December 2nd 04 05:15 AM
Passing an array or recordset to a stored procedure Robin Hammond[_2_] Excel Programming 1 December 2nd 04 05:15 AM
Passing an array or recordset to a stored procedure Jamie Collins Excel Programming 1 December 2nd 04 05:15 AM


All times are GMT +1. The time now is 10:22 AM.

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

About Us

"It's about Microsoft Excel"