ado recordsets from stored procedures, stored procedures have input parameters 
Author Message
 ado recordsets from stored procedures, stored procedures have input parameters

ado recordsets from stored procedures, stored procedures have input
parameters

i have a sql server (7.0) stored procedure

i want to create an ado recordset off the stored procedure

..

the .sql is

Create PROC usp_10_return_authors_upperlevel


AS

return
GO

and my current vb/ado code is

Private Sub Command1_Click()

On Error GoTo errorhandler:
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

Set cn = CreateObject("ADODB.Connection")
cn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
Catalog=pubs;Data Source=."
Set rs = cn.Execute("EXEC usp_10_return_authors_upperlevel 'a'")

While Not rs.EOF
    MsgBox rs.Fields(0).Value
    rs.MoveNext
Wend

Set rs = Nothing
Set cn = Nothing

Exit Sub

errorhandler:
MsgBox Err.Number & " " & Err.Description

End Sub

..

it cracks on this line

Set rs = cn.Execute("EXEC usp_10_return_authors_upperlevel 'a'")

if i use

Set rs = cn.Execute("EXEC usp_10_return_authors_upperlevel"), it tells me i
don't have the parameter

how do i pass in the parameter??

..

sloan


been acting weird)



Mon, 10 Nov 2003 03:31:38 GMT
 ado recordsets from stored procedures, stored procedures have input parameters

Hi,

I have tested your code, there is no problem with your code list here.
Please check usp_10_return_authors stored procedure.

I replaced it with another procedure which is listed in SQL Server, I can
run the code successfully.

Regards,



Mon, 10 Nov 2003 10:24:45 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. ado recordsets from stored procedures, stored procedures have input parameters

2. Arrays or ADO Recordsets as Input Parameters to Stored Procedures

3. Recordset as input parameter for stored procedure

4. Using Results Of Stored Procedure As Input Into Another Stored Procedure

5. Calling a stored procedure with parameters from another stored procedure

6. Calling a stored procedure with parameters from another stored procedure

7. temporary tables in stored procedures/parameter views vs stored procedures

8. Error at obtaining output parameters of the stored procedure, calling other stored procedure

9. output parameters stored procedures / extended stored procedures

10. How to return Parameters and Recordset from Oracle Stored Procedure with ADO

11. How to bind BLOB parameter of a stored procedure using Parameter Object of ADO


 
Powered by phpBB® Forum Software