ASP內置組件中的Connection對象,主要使用事務處理的方法有以下3個: BeginTrans :用于啟動一個事務 CommitTrans :用于完成/提交一個事務 RollBackTrans : 回滾 一個簡單的例子: 復制代碼 代碼如下: on error resume next objConn.BeginTrans '事務開始 多條SQL語句 If objConn.Errors.Count=0 then objConn.CommitTrans '如果沒有錯誤,則執行事務提交 else objConn.RollbackTrans '否則回滾 End If