ado+access 多用户同时操作问题 (200分)

  • 主题发起人 主题发起人 mhk
  • 开始时间 开始时间
M

mhk

Unregistered / Unconfirmed
GUEST, unregistred user!
[:)]
哪位大侠告诉我怎样多用户同时操作时ado+access
我有一段程序
在AfterInsert, AfterDelet或者AfterPost事件中执行如下代码:
with CustomerQuery do
begin
Database1.StartTransaction;
try
ApplyUpdates; {try to write the updates to the database};
Database1.Commit; {on success, commit the changes};
except
Database1.Rollback; {on failure, undo the changes};
raise; {raise the exception to prevent a call to CommitUpdates!}
end;
CommitUpdates; {on success, clear the cache}
end;
这是用bde时的程序.
而我用的是我使用的是一个adoconnection控件连接
请大侠告知小弟。
 
把DataBase换成Adoconnection就是了
 
AdoQuery.ApplyUpdates(-1);

就ok了

 
ADOConnection.BeginTrans;
ADOConnection.CommitTrans;
ADOConnection.RollbackTrans;
用法跟Database一样
 
主要是ApplyUpdates; 和 CommitUpdates;的替代,其他我会。在connection中这两个
过程怎样写。
 
多人接受答案了。
 
后退
顶部