0
votes

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.rdoParameters(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"

1
Please post the code you have written so far. People generally do not like to just write your code for you. As it is, this is a work description, not a question.Mitch Wheat
Is this better then? I got a problem when running the function a get a ERROR messsage that says: "Could not find item indicated by text"user473104
Is there a reason your using RDO over ADO? If your just starting this project you should consider changing over.Alex K.
Im working with leagacy code from an old project. Thats whyuser473104

1 Answers