1]鏈接好數據庫,並顯示;(設計時的鏈接,和運行時的鏈接,是兩個獨立的鏈接,要區分開)數據庫
procedure TForm1.FormCreate(Sender: TObject); begin FDQuery1.Connection := FDConnection1; FDConnection1.LoginPrompt:=false; //取消登陸提示框 FDConnection1.Open('DriverID=SQLite;Database=test1.Sqlite3.db'); end;
2]增長全部字段;ide
3]添加事件;spa
// FDQuery1UserName: TWideMemoField;設計
procedure TForm1.FDQuery1UserNameGetText(Sender: TField; var Text: string; DisplayText: Boolean); begin Text := Copy(FDQuery1UserName.AsString, 1, 50); end;
4]效果;code