开发环境 VB6+ACCESS2003具体语句如下(YHXX的字段有:用户编号,用户卡号,状态,关系,标识) : sql1 = " update yhxx set 标识='',关系='无效' where 用户编号=1 and 状态='正常' and 关系='有效' and 标识='有效' "
sql2 = " update yhxx set 关系='无效' where 用户卡号=2 and 状态='正常' and 关系='有效' and 标识='有效' "
On Error GoTo Errb
Dim cc As Boolean
Conn.BeginTrans
If Check1.value = 1 Then '开户错
Conn.Execute sql1, n1
Conn.Execute sql2, n2
conn.committrans
sql1和sql2应该是各作用一条记录,两条记录互不相干,但是执行后却 发现
Conn.Execute sql1, n1
Conn.Execute sql2, n2 执行完后n1=1 ,n2=0 改变一下顺序
Conn.Execute sql2, n2
Conn.Execute sql1, n1 执行完后n2=1 ,n1=0 导致 此事务不能完成
请问是何原因。
sql2 = " update yhxx set 关系='无效' where 用户卡号=2 and 状态='正常' and 关系='有效' and 标识='有效' "
On Error GoTo Errb
Dim cc As Boolean
Conn.BeginTrans
If Check1.value = 1 Then '开户错
Conn.Execute sql1, n1
Conn.Execute sql2, n2
conn.committrans
sql1和sql2应该是各作用一条记录,两条记录互不相干,但是执行后却 发现
Conn.Execute sql1, n1
Conn.Execute sql2, n2 执行完后n1=1 ,n2=0 改变一下顺序
Conn.Execute sql2, n2
Conn.Execute sql1, n1 执行完后n2=1 ,n1=0 导致 此事务不能完成
请问是何原因。
用户编号=1 and 状态='正常' and 关系='有效' and 标识='有效' " 符合的记录,标识='',关系='无效' 被执行后,不再有满足条件: 用户卡号=2 and 状态='正常' and 关系='有效' and 标识='有效' "的记录,或者反之