我有一个程序循环调用一存储过程,用同一个ADO连接,结果运行某一条的时候超时
我把SQL它拿到查询分析器中,执行却十分的迅速为什么?

解决方案 »

  1.   

    我单步试验过了老是卡在一个地方,我把所有发送过的SQL 放到查询分析器中一块执行却没出现问题,我还发现正常数据ADO 的速度也比查询分析器中来的慢
    ,锁我也看了,只有S 和IS 锁 ,我所做的工作都是查询没有其他操作
      

  2.   

    调用的部分代码如下
    Public Function GetDCheck(strCustomerID As String, strOrderNo As String) As Long
        Dim Cmd As New ADODB.Command    With Cmd
            .ActiveConnection = mAdoConn
            .CommandType = adCmdStoredProc
            .CommandText = "DeliveryGetDCheck"
            .Parameters(1) = strCustomerID
            .Parameters(2) = strOrderNo
            .Execute
            GetDCheck = .Parameters(0)
        End With
    End Function