How does ZMenTable work?
I didn't find any documentation about it...
Thanks
ZMemTable ?
Re: ZMemTable ?
ZMemTable works like a ClientDataSet or any other memory dataset should:
- You create FieldDefs (ZMemTable.FieldDefs.Add)
- You open the dataset (ZMemTable.Open)
- Add, remove, manipulate data as usual (ZMemTable.FieldByName, ZMemTable.Filter, ZMemTable.Next, etc)
- Close the dataset (ZMemTable.Close)
Is this enough to keep you started? If no, please ask something more exact - vague question usually results a vague answer.
- You create FieldDefs (ZMemTable.FieldDefs.Add)
- You open the dataset (ZMemTable.Open)
- Add, remove, manipulate data as usual (ZMemTable.FieldByName, ZMemTable.Filter, ZMemTable.Next, etc)
- Close the dataset (ZMemTable.Close)
Is this enough to keep you started? If no, please ask something more exact - vague question usually results a vague answer.
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Re: ZMemTable ?
and:
Michal
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
ZMemTable1.Close;
ZMemTable1.FieldDefs.Clear;;
ZMemTable1.AssignDataFrom(ZQuery2);
end;
procedure TForm1.Button2Click(Sender: TObject);
var fs: TFileStream;
begin
fs := TFileStream.Create('t2code.bin', fmCreate);
Try
ZMemTable1.SaveToStream(fs);
Finally
fs.Free;
End;
end;
procedure TForm1.Button3Click(Sender: TObject);
var fs: TFileStream;
begin
ZMemTable1.Close;
ZMemTable1.FieldDefs.Clear;
fs := TFileStream.Create('t2code.bin', fmOpenRead);
Try
ZMemTable1.LoadFromStream(fs);
Finally
fs.Free;
End;
end;
-
- Fresh Boarder
- Posts: 8
- Joined: 12.07.2024, 16:16
Re: ZMemTable ?
Thank you very much, that's exactly what I wanted to know, how to load data from a query to Zmemtable