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 2:27PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.