fdLocalSql可以对fdMemTable内存表进行SQL查询(可以对多个fdMemTable内存表进行联表查询哦),fdLocalSql使用SQLITE引擎,而FIREDAC驱动SQLITE,连SQLITE驱动DLL都不需要附带的。
1)设置fdConnection为SQLITE,LoginPrompt设为False;
2)设置TfdLocalSQL 的Connection
3)拖一个FDMemTable1,FDQuery1到界面上,然后 进入代码窗口
procedure TForm1.FormCreate(Sender: TObject); begin Brands.FieldDefs.Add('ID', ftInteger, 0, True); Brands.FieldDefs.Add('Name', ftString, 20, false); Brands.CreateDataSet(); Brands.AppendRecord([101, 'aaa']); Brands.AppendRecord([102, 'bbb']); Brands.AppendRecord([103, 'ccc']); Brands.LocalSQL:= FDLocalSQL1; Brands.Active:=true; FDQuery1.Connection:= FDConnection1; FDQuery1.SQL.Text:='select * from Brands where id>101 ' ; FDQuery1.Active:=true; end;
标签:02,SQLITE,FDQuery1,delphi,FDMemTable,AppendRecord,内存,SQL,Brands From: https://www.cnblogs.com/tulater/p/18047082