方法一
FDQuery4.SQL.Text := 'INSERT INTO?信息表 (中心, 分組) values(:中心,:分組)';
FDQuery4.Params[0].DataType := ftWideString;? //必須加這個數據類型的定義,否則會有亂碼
FDQuery4.Params[1].DataType := ftWideString;? //ftstring就不行,必須是ftWideString
FDQuery4.Params.ParamByName('中心').AsString := '中心';
FDQuery4.Params.ParamByName('分組').AsString := '一組';
方法二
FDQuery4.SQL.Text := 'INSERT INTO?信息表 (中心, 分組) values(''中心'',''一組'')';
//這樣寫沒問題
備忘:使用FD不如ADO簡單,?賦值時必須顯式指定參數類型,務必注意。