正如头条说我想用参数调用存储过程。 下面是VB6功能
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
下面的存储过程
CREATE PROCEDURE Insert_Student
@Name VARCHAR(50)
AS
BEGIN
INSERT INTO dbo.Student (Name)
VALUES (@Name)
END
GO
运行该功能时出现问题。运行“CPw.rdoParameters(0).Direction = rdParamReturnValue”行时出现错误消息:“无效描述索引”
答案 0 :(得分:1)
MSDN上的这个页面应该很好地解释它:
http://msdn.microsoft.com/en-us/library/aa240826%28v=VS.60%29.aspx