经典的 asp connection.errors 集合实际上是如何工作的?
我试图确认实际的 ADODB.Connection.Errors 集合实际上应该如何工作。
我目前的解释是,该连接将保留在该连接上执行的所有过程的所有错误。
所以我应该可以说
on error resume next
... code goes here ... 2 or more command objects execute procedures against the database on the same connection
if con.Errors <> 0 then
loop through all the Errors objects (1 for each procedure that would've been executed on the connection)
end if
但是我已经实现了该基本结构并且我只得到了一个错误描述?所以我正在寻找某人来确认情况确实如此。 Errors 集合是否包含多个过程的多个错误?或者一个过程是否发生多个错误?
我似乎找不到任何文档可以准确说明这种情况下会发生什么。
谢谢,
I am trying to confirm how the actual ADODB.Connection.Errors collection should actually work.
My interpretation at the moment is that the connection will hold all the errors for the all the procedures that have been executed on that connection.
So I should be able to say
on error resume next
... code goes here ... 2 or more command objects execute procedures against the database on the same connection
if con.Errors <> 0 then
loop through all the Errors objects (1 for each procedure that would've been executed on the connection)
end if
However I have implemented that basic structure and I only get the one error description? So I am looking for someone to confirm that is the case. Does the Errors collection hold more than one error for more than one procedure? Or is if multiple errors occurred for one procedure?
I can't seem to find any documentation that would indicate exactly what would happen in this case.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自 错误集合 (ADO) - MSDN:
因此,要捕获所有错误,似乎需要在每个可能的错误后检查集合。
from Errors Collection (ADO) - MSDN:
So, to catch all errors, seems to be need to check the collection after each possible error.