What do you need to know - how to write the stored procedure to return rows OR how to execute it from VB OR all of the preceding? Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
If all you need to do is return rows from a table or tables, you don't need to execute a stored procedure. Just query the table or create a view and query the view from VB.
Read SQL Books Online for details about creating stored procedures.
Hope this info helps. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
This is actually rather simple. When a stored procedure that is written as a select statement is returned from VB, it is returned as a recordset.
First create your stored proc and make sure it's installled on SQL Server See the example in this thread. If it's a simple stored proc without parameters, just call it how you would call any recordset: rs.open "proc_name_here", conn
If it's a proc with input parameters, you need to create a command object first. Then do as follows:
With cmdProc
.CommandText = "proc_name_here"
.CommandType = adCmdStoredProc
.ActiveConnection = adoConn
End With
Set rsData = cmdProc.Execute(, Array("parameter_here", "parameter here")
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.