主题:关于数据库事务回滚
try
//DataModule2.ADOQuery1.BeginTrans;
DataModule2.ADOQuery1.Insert;
DataModule2.ADOQuery1.FieldByName('admin').AsString:=edit1.Text;
DataModule2.ADOQuery1.FieldByName('password').AsString:=edit2.Text;
DataModule2.ADOQuery1.Post;
//DataModule2.ADOQuery1.CommitTrans;
except
// DataModule2.ADOQuery1.RollbackTrans;
end;
注释语句老是报无法识别 :BeginTrans,CommitTrans,RollbackTrans;
我的单元文件引用如下
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, DBGrids,ADODB,DB;
此帖转自:[url]http://www.programfan.com/team/team.asp?team_id=1382[/url]
//DataModule2.ADOQuery1.BeginTrans;
DataModule2.ADOQuery1.Insert;
DataModule2.ADOQuery1.FieldByName('admin').AsString:=edit1.Text;
DataModule2.ADOQuery1.FieldByName('password').AsString:=edit2.Text;
DataModule2.ADOQuery1.Post;
//DataModule2.ADOQuery1.CommitTrans;
except
// DataModule2.ADOQuery1.RollbackTrans;
end;
注释语句老是报无法识别 :BeginTrans,CommitTrans,RollbackTrans;
我的单元文件引用如下
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, DBGrids,ADODB,DB;
此帖转自:[url]http://www.programfan.com/team/team.asp?team_id=1382[/url]