You are not logged in.
Some years ago, I used TSynSQLTableDataSet to create a TDataset from a FillTable.
I need to create a report from a TSQLRecord descendant in FastReport, now. I see that mORMot have new ways of create TDatasets. There are a better way now?
uses mORMotVCL;
var
Animal: TSQLAnimal;
begin
Animal := TSQLAnimal.Create;
try
Animal.FillPrepare(DB, 'Nome=?',['Tom']);
ds1.Dataset.Free;
ds1.DataSet := <some-thing-to-dataset>(Animal);
// create my report
finally
Animal.Free;
end;
end;
Last edited by Junior/RO (2015-03-24 20:43:51)
Offline
Arnaud?
Offline
You have
- function ToClientDataSet() in mORMotMidasVCL.pas
- TSynSQLTableDataSet.Create() or TSynSQLTableDataSet.CreateOwnedTable() in mORMotVCL.pas
The first uses a TClientDataSet so is slower than the previous, and more memory consuming.
But it could be updated in place, so is read/write.
But the TSynSQLTableDataSet class is a better solution (faster, less memory, no dependency to Midas), for a read-only TDataSet.
So IMHO for filling a report, mORMotVCL.pas is the best option.
Online
Thank you.
Before I asked this question, I have read the documentation and found ToDataSet() and ToClientDataSet(). But I don't know how to use them with my TSQLAnimal class. The examples show only with direct aProps.Execute(), not in the ORM way.
May I ask you to show a example of aTSQLRecord.FillPrepare + ToClientDataSet()?
Last edited by Junior/RO (2015-03-25 16:05:29)
Offline