经典的asp connection.errors集合实际上如何工作? [英] How does the classic asp connection.errors collection actually work?

查看:108
本文介绍了经典的asp connection.errors集合实际上如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试确认实际的ADODB.Connection.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.

所以我应该可以说

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.

谢谢

推荐答案

来自

任何涉及ADO对象的操作都可以生成一个或多个提供程序 错误.发生每个错误时,可以放置一个或多个错误对象 在Connection对象的Errors集合中. 当另一个ADO 操作生成错误,清除了Errors集合,并且 新的Error对象集可以放置在Errors集合中..

Any operation involving ADO objects can generate one or more provider errors. As each error occurs, one or more Error objects can be placed in the Errors collection of the Connection object. When another ADO operation generates an error, the Errors collection is cleared, and the new set of Error objects can be placed in the Errors collection.

因此,要捕获所有错误,似乎需要在每个可能的错误之后检查集合.

So, to catch all errors, seems to be need to check the collection after each possible error.

这篇关于经典的asp connection.errors集合实际上如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆