调试ASP存储过程调用

时间:2009-12-01 21:17:52

标签: stored-procedures asp-classic

我正在使用以下代码块来调用SQL Server 2005存储过程。问题是呼叫将间歇性地失败。如何获取有关故障情况的更详细信息。我用失败的输入测试了SP,发现没有问题。这似乎表明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

1 个答案:

答案 0 :(得分:2)

Connection对象有一个可以旋转的错误集合:

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