Subject | Delphi-Ibo spesific question... |
---|---|
Author | Burak ÖZLER |
Post date | 2004-04-14T08:16:44Z |
Hi all
I'm creating TIB_Query component dynamicaly at my functions... like this...
Function TDataMod.Get_Doviz_Kur(PRM_DOVKOD:String;PRM_TARIH:TDateTime;PRM_TIP:Byte;PRM_ISN:Integer):Currency;
var qryDOVKUR:TIB_Query;
Msg : PChar;
begin
try
try
if Trim(PRM_DOVKOD) = glb_DEFCUR then
begin
Result := 1;
Exit;
end;
DataMod.CreateQuery(qryDOVKUR,nil,False,True);
DO SMTHING XXXXXXXXXXXXXXXXXXXXXXXXXXxxx
except
Application.MessageBox(MSG,'Dikkat',MB_ICONERROR);
Result := 0;
raise;
end;
finally
DataMod.ReleaseQuery(qryDOVKUR);
end;
end;
Procedure TDataMod.CreateQuery(Var Query:TIB_Query;Transaction:TIB_Transaction;RequestLive,ReadOnly:Boolean);
begin
Query := TIB_Query.Create(Self);
Query.IB_Connection := DataMod.dbaMain;
if Transaction <> Nil then Query.IB_Transaction := Transaction;
Query.RequestLive := RequestLive;
Query.ReadOnly := ReadOnly;
end;
Procedure TDataMod.ReleaseQuery(var Query:TIB_Query);
begin
if Query <> Nil then
begin
if Query.Active then Query.Close;
Query.Free;
end;
end;
if Trim(PRM_DOVKOD) = glb_DEFCUR then if the equality accures qryDOVKUR.Create never runs, but the object is on the memory.
1 - Do I have to free the query at function end ( Delphi basics says no need memmanager will free it for me)
2- if yes How can I know that IB_Query.Create has run for the object or not?
With my best regards
Burak OZLER
[Non-text portions of this message have been removed]
I'm creating TIB_Query component dynamicaly at my functions... like this...
Function TDataMod.Get_Doviz_Kur(PRM_DOVKOD:String;PRM_TARIH:TDateTime;PRM_TIP:Byte;PRM_ISN:Integer):Currency;
var qryDOVKUR:TIB_Query;
Msg : PChar;
begin
try
try
if Trim(PRM_DOVKOD) = glb_DEFCUR then
begin
Result := 1;
Exit;
end;
DataMod.CreateQuery(qryDOVKUR,nil,False,True);
DO SMTHING XXXXXXXXXXXXXXXXXXXXXXXXXXxxx
except
Application.MessageBox(MSG,'Dikkat',MB_ICONERROR);
Result := 0;
raise;
end;
finally
DataMod.ReleaseQuery(qryDOVKUR);
end;
end;
Procedure TDataMod.CreateQuery(Var Query:TIB_Query;Transaction:TIB_Transaction;RequestLive,ReadOnly:Boolean);
begin
Query := TIB_Query.Create(Self);
Query.IB_Connection := DataMod.dbaMain;
if Transaction <> Nil then Query.IB_Transaction := Transaction;
Query.RequestLive := RequestLive;
Query.ReadOnly := ReadOnly;
end;
Procedure TDataMod.ReleaseQuery(var Query:TIB_Query);
begin
if Query <> Nil then
begin
if Query.Active then Query.Close;
Query.Free;
end;
end;
if Trim(PRM_DOVKOD) = glb_DEFCUR then if the equality accures qryDOVKUR.Create never runs, but the object is on the memory.
1 - Do I have to free the query at function end ( Delphi basics says no need memmanager will free it for me)
2- if yes How can I know that IB_Query.Create has run for the object or not?
With my best regards
Burak OZLER
[Non-text portions of this message have been removed]