我看了一些参考书,有些数据库不支持事务控制,但我用的是ODBC连接SQLSERVER2000,不知是否支持?如果支持又如何写?

解决方案 »

  1.   

    参考
    http://community.csdn.net/Expert/topic/3213/3213960.xml?temp=.5166437
      

  2.   

    http://community.csdn.net/Expert/topic/3213/3213960.xml?temp=.227276
      

  3.   

    'conn 数据库联接
    conn.beginTrans'执行数据库操作if error then
       conn.RollbackTrans
    else
       conn.CommitTrans
    end if
      

  4.   

    '先打开数据库连接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
      

  5.   

    应该是支持的
    连 access jet...都支持
    具体语句楼上已给出 基本上就是那样了