Lazarus下特别是linux aarch64下使用简单的三层控件特别难找,综合已有的代码,在2022年最后一天,写了个简单的三层,其中服务端使用了UNIDAC和RealThinClientSDK,客户端简单封装了TQFRemoteConnection,TQFRemoteTable和TQFRemoteQuery3个控件,这个三层中间与大佬们写的三层的没得比,纯自娱自乐,请各位口下留情。
使用起来也是挺简单的:
procedure TForm1.Button2Click(Sender: TObject); begin QFConnect1:=TQFRemoteConnection.Create; QFConnect1.server_ip:=edit1.Text; QFConnect1.server_port:=edit2.text; QFTable:=TQFRemoteTable.Create(self); QFTable.Connection:=QFConnect1; DataSource1.DataSet:=QFTable; QFTable.TableName:='混凝土试块数据'; QFTable.KeyFields:='报告编号,序号'; QFTable.open; Label2.Caption:=QFTable.RecordCount.ToString; end; procedure TForm1.Button1Click(Sender: TObject); begin QFConnect1:=TQFRemoteConnection.Create; QFConnect1.server_ip:=edit1.Text; QFConnect1.server_port:=edit2.text; QFQuery:=TQFRemoteQuery.Create(self); QFQuery.Connection:=QFConnect1; DataSource1.DataSet:=QFQuery; QFQuery.SQL:=edit3.text; QFQuery.open; Label2.Caption:=QFQuery.RecordCount.ToString; end; procedure TForm1.Button3Click(Sender: TObject); begin QFTable.updates; end; procedure TForm1.Button4Click(Sender: TObject); begin QFQuery.KeyFields:='用户名'; QFQuery.updates; end;
windows:
银河麒麟linux arm64运行截图:
标签:windows,Create,QFQuery,QFConnect1,lazarus,linux,三层,QFTable From: https://www.cnblogs.com/qiufeng2014/p/17016969.html