crash when i use my own dataset - DELPHI


I use a TfrxDBDataset (frxDBDataSet1),
an ADOQuery (ADOQuery1) and a Button as follows ....


procedure TPrintLS.Button1Click(Sender: TObject);
var WhereExpr : string;
begin
{

here there is code for fixing WhereExpr .....

}
With ADOQuery1 Do
Begin
SQL.Clear;
SQL.Text:='SELECT field1, field2, field3 '+
'FROM logariasmoi ORDER BY field1'+
'WHERE '+WhereExpr;
Open;
End;
frxDBDataset1.DataSet:=ADOQuery1;
frxReport1.ShowReport;

end;


when i press once the button - everything ok !!!
twice - everything ok !!!!
third - crash all [ program and delphi !!! - needed Ctrl+Alt+Delete]


I try to solve this problem about one week ........

If anyone knows to help I 'll appriciate

thanks





Comments

  • edited 8:09PM
    I'm simply guessing here.
    Looks to me that something is overusing memory.Try to put this code before you call and after it.

    Application.ProcessMessages;

    If you are calling a report with that click give it
    Report.Free;
    or if you are calling some form put on close form event
    Release;

Leave a Comment