My code error???Thanks!!

I have designed my report in the FastReport designer,then I wirte the code below,but when run,it's show error"cannot use the same dataset for report.dataset and band.dataset"

procedure TForm1.Button1Click(Sender: TObject);
begin
ADOQuery1.SQL.Add('SELECT * FROM TJ where xm like ''%王%''');
frxDBDataset2.DataSet:=ADOQuery1;
frxReport2.DataSet:=frxDBDataset2;
frxReport2.showreport;
end;
end.

how can i do????
thanks!

Comments

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.