数据库test1 表a1
数据库test2 表a1
两个事务已成功连接了 利用sql来修改提交数据也成功了 现在就是想用数据窗口来实现,哪位大神来啊
全部变量
Transaction transa_1,transa_2
transa_1 = CREATE Transaction
transa_2 = CREATE Transaction
// Profile test1
transa_1.DBMS = "ODBC"
transa_1.AutoCommit = False
transa_1.DBParm = "ConnectString='DSN=test1;UID=sa;PWD=zx'"
// Profile test2
transa_2.DBMS = "ODBC"
transa_2.AutoCommit = False
transa_2.DBParm = "ConnectString='DSN=test2;UID=sa;PWD=zx'"
connect using transa_1;
connect using transa_2;
if transa_1.sqlcode>=0 and transa_2.sqlcode>=0 then
messagebox("成功","已经连接数据库成功")
else
messagebox("失败","不能连接数据库")
return
end if
open(test)
test:
Insert Into a1(num_id) values('12345');
Commit using transa_1;
Commit using transa_2;
------解决方案--------------------
SQL语句可以这样:
Insert Into a1(num_id) values('12345') using transa_1;
Commit using transa_1;
Insert Into a1(num_id) values('12345') using transa_2;
Commit using transa_2;
数据窗口可以这样(多事务保存数据):
先settransobject(transa_1),update(false,false)
再settransobject(transa_2),update(false,false)
...