2009-12-01 64 views
0

我正在使用以下代碼塊來調用SQL Server 2005存儲過程。問題是電話會間歇性地失敗。我怎樣才能獲得有關失敗案例的更詳細的信息。我用失敗的輸入測試了SP,發現沒有問題。這似乎表明ASP方面存在錯誤。調試ASP存儲過程調用

Set rsOrderItems = Server.CreateObject("ADODB.Recordset") 
rsOrderItems.ActiveConnection = MM_SkateSeason_Connect 
rsOrderItems.CursorType = 0 
rsOrderItems.CursorLocation = 2 
rsOrderItems.LockType = 1 
rsOrderItems.Source = "{call dbo.upOrder_InsertNew('" & MM_OrderString & "')}" 
on error resume next 
rsOrderItems.Open 


if (rsOrderItems.State) then 
else 
    FAILS HERE 
    InsertOrder = "Order Failed. 2" 
end if 

回答

2

Connection對象有一個錯誤集合,您可以通過旋轉:

 
For Each errorObject In MM_SkateSeason_Connect.Errors 
    Debug.Print "Description :"; errorObject.Description 
    Debug.Print "Number:"; errorObject.Number 
Next