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 populating DataGrid from Recordset(data retrieved from stored procedure using 3 parameters)

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

3. To Stored Procedure or not to stored procedure

4. To stored procedure or not to stored procedure

5. sub report changes its source stored procedure to main report's stored procedure

6. To stored procedure or not to stored procedure

7. Passing Array as Input Parameter to Oracle Stored Procedure

8. Help: SubReport based on Stored procedure with an input parameter

9. Input Parameter for Stored Procedure

10. Connecting to Oracle stored procedures with both input and output parameters

11. Passing Array as Input Parameter to Oracle Stored Procedure

12. input parameter in Store Procedure

 

 
Powered by phpBB® Forum Software