开发者

VB6 Call stored procedure with parameters

As the headling says I want to call a stored procedure with parameters. Below is the VB6-function that

Private Sub TestProcedur() Dim strSql As String Dim CPw As rdoQuery

strSql$ = "? = {call Insert_Student(?) }"
Set CPw = gRdoConn.CreateQuery("InsertStudent", strSql)

CPw.rdoPar开发者_开发问答ameters(0).Direction = rdParamReturnValue



CPw(1) = "FRANK"

Set mrsR = CPw.OpenResultset()

End Sub

The stored procedure below

CREATE PROCEDURE Insert_Student
    @Name VARCHAR(50)
AS
BEGIN
    INSERT INTO dbo.Student (Name)
    VALUES (@Name)
END
GO

I'm getting a problem when running the function. A ERROR messsage occurs when running the line "CPw.rdoParameters(0).Direction = rdParamReturnValue" that says: Not valid description index"


This page on MSDN should explain it nicely:

http://msdn.microsoft.com/en-us/library/aa240826%28v=VS.60%29.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜