type
TThQuery=Class
public
FSession:TSession;
FDatabase:TDatabase;
FConn:TADOConnection;
qry1,qry2,qry3:TADoQuery;
Prepared:Boolean;
constructor Create;
destructor Destroy;override;
procedure Free;
end;
procedure TThQuery.Free;
begin
inherited;
end;
destructor TThQuery.Destroy;
begin
if Assigned(qry1) then
begin
qry1.Close;
qry1.Free;
end;
if Assigned(qry2) then
begin
qry2.Close;
qry2.Free;
end;
if Assigned(qry3) then
begin
qry3.Close;
qry3.Free;
end;
if Assigned(FConn) then
begin
FConn.Close;
FConn.Free;
end;
inherited;
end;
constructor TThQuery.Create;
begin
inherited;
Prepared:=false;
try
FConn:=TAdoConnection.Create(nil);
FConn.LoginPrompt:=false;
FConn.ConnectionString :='DRIVER=Sybase System 11;SRVR='+glServerName+';DB='+glDbName+';UID='+glUserName+';password='+glPassword;
FConn.Open;
qry1:=TAdoQuery.Create(nil);
qry2:=TAdoQuery.Create(nil);
qry3:=TAdoQuery.Create(nil);
qry1.Connection:=FConn;
qry2.Connection:=FConn;
qry3.Connection:=FConn;
Prepared:=true;
except
on E:Exceptiondo
if DEBUG then
showmessage (inttostr(e.HelpContext)+':'+e.Message);
end;
end;