当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO BeginTrans, CommitTrans,
These 3 methods is used with the Connection object to save or cancel changes made to the data source.
这三个方法可以和Connection对象一起使用,它是用来存储或取消对数据源作出的更改。
Note: Not all providers support transactions.
注意:并不是所有的技术提供对象[provider]都支持事务处理的。
Note: These 3 methods are not available on a client-side Connection object.
注意:这三个方法不可以用在客户端的Connection对象上。
The BeginTrans method starts a new transaction.
BeginTrans 方法的作用是:开始一个新的处理事务。
This method can also be used to return a long value that is the level of nested transactions. A top level transaction has a return value of 1. Each additional level increments by one.
这个方法将用一个值的形式返回事务嵌套的等级。如果一个最高等级事务将返回1,其它额外的事务等级将以1为基数递增(如:二级事务值为2,等等,依次递增)。
The CommitTrans method saves all changes made since the last BeginTrans method call, and ends the current transaction.
CommitTrans方法的作用是:保存连接上打开的事务中所做的更改并结束事务。
Since transactions can be nested, all lower-level transactions must be resolved before you can resolve higher-level transactions.
因为事务也可以嵌套,所以低级别的事务必须在处理高级别事务之前处理。
The RollbackTrans method cancels all changes made since the last BeginTrans method call, and ends the transaction.
RollbackTrans方法的作用是:取消在连接上打开的事务中所做的更改并结束事务。
Since transactions can be nested, all lower-level transactions must be resolved before you can resolve higher-level transactions.
因为事务也可以嵌套,所以低级别的事务必须在处理高级别事务之前处理。
level=BeginTrans() objconn.BeginTrans objconn.CommitTrans objconn.RollbackTrans |