1 2 3 4 5 6 7 8 9 下一页
问题提出:写了一个数据库操作的类TDBOperate_DL,统一对数据库的操作嘛。提供了声明事务开始、提交事务和回滚事务的方法供其他类调用。
TDBOperate_DL = class
private
ADOC:TADOConnection;
ADOQ:TADOQuery;
isDestroyADOC:Boolean; //是否销毁自己的ADOC?
fIsInTrans:Boolean; //是否已经开始事务
public
isCommit:Boolean; //是否要提交事务,缺省是真,如果有类投票说反对提交,就为假
function IsInTrans:Boolean;
constructor Create(const newADOC:TADOConnection);overload;
constructor Create(const ServerName,DataBaseName,UserID,Password:String);overload;
destructor Destroy;override;
procedure BeginTrans;
procedure CommitTrans;
procedure RollbackTrans;
procedure Execute(const sqlString:String);
function GetDataset(const sqlString:String):_Recordset;
function GetConnection:TADOConnection;
1 2 3 4 5 6 7 8 9 下一页
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




