Try Connections("kkk").BeginTransaction() '开始事务 Dim cmd As new SQLCommand cmd.ConnectionName = "kkk" cmd.CommandText = "aaaaaaaaaaaaaaaaaaaaaaa" cmd.ExecuteNonQuery Connections("kkk").Commit '提交事务,所有操作生效 Catch ex As Exception '如果出错 Connections("kkk").Rollback() '回滚事务,撤销所有操作 msgbox(ex.message) End Try