Novice question about Stored Procedures 
Author Message
 Novice question about Stored Procedures

Using VB5 and MS SQL 6.5, how would I code (in VB5) a CALL to a stored
procedure that would return several rows into an RDO resultset.

In other words, I want to put "SELECT * FROM PUBS" in a stored proc
and have VB5 code CALL that Stored Proc, populating an RDO resultset
in VB which I could then work with, rather than having the "SELECT..."
in the VB code.

There would be no parameters passed in this case, just a multirow
resultset returned.

Thanks much in advance for your time and effort!



Fri, 30 Mar 2001 03:00:00 GMT  
 Novice question about Stored Procedures
BJ Bellamy Jr.,

You can do the following --
Dim rdoConn As New rdoConnection
Dim rdoRS As New rdoResultSet
Dim stSQL$
'Code to OpenConnection etc.

stSQL$ = "EXEC select_from_pubs"        'Where select_from_pubs is the SP
name
Set rdoRS = rdoConn.OpenResultset(stSQL$, , , rdExecDirect)

If you had parameters, format them in stSQL. Alternatively, you could
also use rdoQuery. Gives better control over parameters (OUT parameters) and
return values.

-Jay

Quote:

>Using VB5 and MS SQL 6.5, how would I code (in VB5) a CALL to a stored
>procedure that would return several rows into an RDO resultset.

>In other words, I want to put "SELECT * FROM PUBS" in a stored proc
>and have VB5 code CALL that Stored Proc, populating an RDO resultset
>in VB which I could then work with, rather than having the "SELECT..."
>in the VB code.

>There would be no parameters passed in this case, just a multirow
>resultset returned.

>Thanks much in advance for your time and effort!



Fri, 30 Mar 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. To Stored Procedure or not to stored procedure

2. To stored procedure or not to stored procedure

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

4. To stored procedure or not to stored procedure

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

6. Access 2000 VBA - SQL stored procedure question

7. An anoying question about stored procedure

8. Stored procedure question for experienced users...

9. A question about stored procedure?

10. VB, Stored procedure and Oracle Question

11. QUESTIONS about ODBC, network performance and store procedure...

12. Stored procedure question for experienced users...

 

 
Powered by phpBB® Forum Software