Lotus Domino 代理执行存储过程
Domino 代理可以执行存储过程,但目前只支持输入参数,不支持输出参数。可以使用select 语句查询字段来代理输出参数。
以下是一个执行SqlServer存储过程的一个insert(新增)例子:
Sub Initialize On Error Goto errormsg
Dim Parms As New LCFieldList Dim Result As New LCFieldList Dim Parm As LCField Dim Parm1 As LCField Dim Parm2 As LCField Dim Parm3 As LCField Dim Parm4 As LCField Dim count As integer Dim Con As New LCConnection ("oledb") 'SqlServer数据库 Con.Provider = "SQLOLEDB" '数据库名称 Con.Database="dbname" '地址 Con.Server = "127.0.0.1" '帐户、密码 Con.Userid = "sa" Con.Password = "pass123" ' set the connection property to the stored procedure name ' 存储过程名称 Con.Procedure = "insert_bank" ' now connect Con.Connect msgbox "链接成功" '设置输入参数 Set Parm = Parms.Append ("@param1", LCTYPE_TEXT) Parm.text="001" Set Parm1 = Parms.Append ("@param2", LCTYPE_TEXT) Parm.text="li" Set Parm2 = Parms.Append ("@param3", LCTYPE_TEXT) Parm.text="男" Set Parm3 = Parms.Append ("@param4", LCTYPE_TEXT) Parm.text="150" Set Parm4 = Parms.Append ("@param5", LCTYPE_TEXT) '开始执行存储过程 call Con.Call (Parms, 1, Result) '打印结果,结果是返回的sql查询语句的字段 if Con.fetch(Result)>0 then print Result.Lookup("param5").text(0) end if Exit Sub errormsg: Msgbox "Rule Error:" & Str(Erl) & " " & Error End Sub