vb中调用带参数的存储过程

Dim Data_Connection As New ADODB.Connection 'ADO連接對象
    Dim data_RecordSet As New ADODB.Recordset 'ADO的記錄集
    Dim sqlCmdCheckElement As New ADODB.Command
    Dim sqlCmdCalNgNum As New ADODB.Command
    Dim sqlDeleteMTMR As New ADODB.Command 'w2007 liutao 2007/02/28
    Dim sqlCmdNoMR As New ADODB.Command
    Dim sqlCmdNoMRData As New ADODB.Command
    Dim adoParam As New ADODB.Parameter
    Dim XMAX As Single, XMIN As Single, YMAX As Single, YMIN As Single
    Dim Bid As Long
    On Error GoTo CheckElement_ErrHandler
    
    Data_Connection.ConnectionString = ConnectionString
    Data_Connection.ConnectionTimeout = 0
    Data_Connection.Open '打開連接

frmRitek.Label4.Caption = "Check Element ..."
    DoEvents
    MATCHMODE = CInt(Left$(frmRitek.Combo1.Text, 1))
    ciareast = CSng(frmRitek.Text2.Text)
    sqareast = CSng(frmRitek.Text3.Text)
    If MATCHMODE = 0 Then
        sqlCmdCheckElement.ActiveConnection = Data_Connection
        sqlCmdCheckElement.CommandText = "CheckElement"
        sqlCmdCheckElement.CommandType = adCmdStoredProc
        sqlCmdCheckElement.CommandTimeout = 0

Set adoParam = sqlCmdCheckElement.CreateParameter("@ROffset", adSingle, adParamInput, , ROffset)
        sqlCmdCheckElement.Parameters.Append adoParam
        Set adoParam = sqlCmdCheckElement.CreateParameter("@Areatol", adSingle, adParamInput, , Areatol)
        sqlCmdCheckElement.Parameters.Append adoParam 'w1977 added by liutao 2007/01/31
        Set adoParam = sqlCmdCheckElement.CreateParameter("@ungnum", adInteger, adParamOutput)
        sqlCmdCheckElement.Parameters.Append adoParam
        Set adoParam = sqlCmdCheckElement.CreateParameter("@lngnum", adInteger, adParamOutput)
        sqlCmdCheckElement.Parameters.Append adoParam
        Set adoParam = sqlCmdCheckElement.CreateParameter("@oknum", adInteger, adParamOutput)
        sqlCmdCheckElement.Parameters.Append adoParam

sqlCmdCheckElement.Execute
    ungnum = sqlCmdCheckElement.Parameters("@ungnum")
    lngnum = sqlCmdCheckElement.Parameters("@lngnum")
    oknum = sqlCmdCheckElement.Parameters("@oknum")

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值