ZMemTable ?

The offical for ZeosLib 7.3 Report problems, ask for help, post proposals for the new version of Zeoslib 7.3/v8
Quick Info:
-We made two new drivers: odbc(raw and unicode version) and oledb
-GUID domain/field-defined support for FB
-extended error infos of Firebird
-performance ups are still in queue
In future some more feature will arrive, so stay tuned and don't hassitate to help
Post Reply
hffranzin1
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 12.07.2024, 16:16

ZMemTable ?

Post by hffranzin1 »

How does ZMenTable work?

I didn't find any documentation about it...

Thanks
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 796
Joined: 18.11.2018, 17:37
Location: Hungary

Re: ZMemTable ?

Post by aehimself »

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.
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
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Re: ZMemTable ?

Post by miab3 »

and:

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;
Michal
hffranzin1
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 12.07.2024, 16:16

Re: ZMemTable ?

Post by hffranzin1 »

Thank you very much, that's exactly what I wanted to know, how to load data from a query to Zmemtable
Post Reply