xorpas 4 Posted August 13, 2023 i have an issu with FireDac it store Arabic characters as question marks (???) code create database at runtime is var SQL: string; FConnection: TFDConnection; begin FConnection := TFDConnection.Create(nil); FConnection.DriverName := 'SQLite'; FConnection.Params.Add('OpenMode=CreateUTF8'); FConnection.Params.Add('CharacterSet=UTF8'); FConnection.Params.Database := DB; FConnection.Open; SQL := 'CREATE TABLE Contact (ID INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT, Phone TEXT, Img BLOB)'; FConnection.Open; FConnection.ExecSQL(SQL); FConnection.Close; and insert is Connection := TFDConnection.Create(nil); Connection.DriverName := 'SQLite'; Connection.Params.Database := DB; Connection.Params.Add('OpenMode=CreateUTF8'); Connection.Params.Add('CharacterSet=UTF8'); Connection.Open; Query := TFDQuery.Create(nil); Query.Connection := Connection; begin Query.SQL.Text := 'INSERT INTO Contact (Name, Phone, Img) VALUES (:Name, :Phone, :Img)'; if Param[0] = '' then exit; if Param[1] = '' then exit; begin Query.ParamByName('Name').AsString := (Param[0]); Query.ParamByName('Phone').AsString := Param[1]; stream := TMemoryStream.Create; if Param[2] = 'nil' then begin end else begin stream.LoadFromFile(Param[2]); Query.ParamByName('Img').LoadFromStream(stream, ftBlob); end; Query.ExecSQL; stream.Free; end; end; help to solve this issue Share this post Link to post
Andy.B 1 Posted August 14, 2023 (edited) Hi, try this Query.ParamByName('Name').AsWideString := ... Regards Edited August 14, 2023 by Andy.B 1 Share this post Link to post
xorpas 4 Posted August 14, 2023 11 hours ago, Andy.B said: Hi, try this Query.ParamByName('Name').AsWideString := ... Regards Best regards it work now thank you for reply mr andy Share this post Link to post