'conn 数据库联接 conn.beginTrans'执行数据库操作if error then conn.RollbackTrans else conn.CommitTrans end if
'先打开数据库连接conn Err.clear conn.BeginTrans '插入、更新操作 conn.execute "insert into table1(col1,col2) values(value1,value2)" conn.execute "update table2 set co11=value1,col2=value2" if Err then conn.RollbackTrans'回滚 else conn.CommitTrans'提交更新 end if conn.close set conn=nothing
http://community.csdn.net/Expert/topic/3213/3213960.xml?temp=.5166437
conn.beginTrans'执行数据库操作if error then
conn.RollbackTrans
else
conn.CommitTrans
end if
Err.clear
conn.BeginTrans
'插入、更新操作
conn.execute "insert into table1(col1,col2) values(value1,value2)"
conn.execute "update table2 set co11=value1,col2=value2"
if Err then
conn.RollbackTrans'回滚
else
conn.CommitTrans'提交更新
end if
conn.close
set conn=nothing
连 access jet...都支持
具体语句楼上已给出 基本上就是那样了