二进制CRUD

二进制CRUD

只适用于delphi客户端,不支持其他语言。

多表查询

procedure TForm1.btnClick(Sender: TObject);
// 多表查询
begin
  var bin: TBin;
  bin.resource := 'bin';
  bin.dbid := '1';
  bin.sqls := ['select * from tgoods', 'select * from tunit'];
  bin.dss := [ClientDataSet1, ClientDataSet2];
  bin.qry;
end;

  多表保存

procedure TForm1.Button1Click(Sender: TObject);
// 多表保存
begin
  var bin: TBin;
  bin.resource := 'bin';
  bin.dbid := '1';
  bin.tblNames := ['tgoods', 'tunit'];
  bin.noSaveFlds := ['', ''];
  bin.dss := [ClientDataSet1, ClientDataSet2];
  bin.save;
end;

  单表查询

procedure TForm1.Button5Click(Sender: TObject);
//单表查询
begin
  var bin: TBin;
  bin.resource := 'bin';
  bin.dbid := '1';
  bin.sqls := ['select * from tgoods'];
  bin.dss := [ClientDataSet1];
  bin.qry;
end;

  单表保存

procedure TForm1.Button6Click(Sender: TObject);
//单表保存
begin
  var bin: TBin;
  bin.resource := 'bin';
  bin.dbid := '1';
  bin.tblNames := ['tgoods'];
  bin.noSaveFlds := [''];
  bin.dss := [ClientDataSet1];
  bin.save;
end;

  execsql

procedure TForm1.Button7Click(Sender: TObject);
// execsql
begin
  var bin: TBin;
  bin.resource := 'bin';
  bin.dbid := '1';
  bin.sql := 'delete from tunit where unitid=''1''';
  bin.execsql;
end;

  

posted @ 2023-08-10 17:14  delphi中间件  阅读(119)  评论(0编辑  收藏  举报