|
Paul
We've
done this many times - I don't have the code with me ATM, but its in the
form:
function TForm1.GetDataset(AOwner: TComponent):
TClientDataset; var tbl : TClientDataset; fld :
TField; begin tbl := TClientDataset.Create(AOwner); with
tbl.FieldDefs.AddFieldDef do begin Name :=
'FirstField'; DataType := ftInteger;
end; with tbl.FieldDefs.AddFieldDef do
begin Name := 'SecondField';
DataType := ftString; end; tbl.Open;
..... end;
You
can also set up the ClientDatasets in the IDE - just set up the FieldDefs only,
then Open.
If you
need more I can send you a working demo tomorrow.
Cheers
Stephen
How do I setup a ClientDataSet as an
In-Memory Table ?
I have placed a TClientDataSet in the DataModule
there is no Provider and no File.
I have tried creating FieldDefs, Persistant
Fields, and both.
I want to be able to populate the Fields (many
rows) of the ClientDataSet - Do some heavy processing - then just clear
it.
I do not require any storage for the
Data.
The problem is that when I set the DataSet Active
- It blows up because there is no provider.
I have been told that this can be done - I am
starting to doubt it though...
Regards Paul McKenzie Analyst
Programmer SMSS Ltd.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This communication contains information that is confidential and the copyright of ensynergy Limited or a third party. If you are not the intended recipient of this communication please delete and destroy all copies and telephone ensynergy Limited on +64 9 3551591 immediately. If you are the intended recipient of this communication you should not copy, disclose or distribute this communication without the authority of ensynergy Limited. Any views expressed in this communication are those of the individual sender, except where the sender specifically states them to be the views of ensynergy Limited. Except as required by law, ensynergy Limited does not represent, warrant and/or guarantee that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.
|