Is there a way to write in an locale database?

  

i’m learning to use firemonkey, and i made an app that i’m using on my phone (it works like a reminder if u want) so basically there’s a database file (SQLite) in my phone’s internal storage, and in the form i put a TMemo + FDConnection + FDPhysSQLiteDriverLink so the app can read the database and display it on the TMemo, now i did put a TEdit and i added a button i want what i write on the TEdit to be added to the database.
i’m new to SQL delphi and stack overflow in general.
thanks

PS: i’m trying to do it without using livebindings.

var
query: TFDQuery;
begin

query := TFDQuery.Create(nil);

try
// Define the SQL Query
query.Connection := FDConnection1;
query.SQL.Text := ‘SELECT * FROM Employee’;
query.Open();
outputMemo.Text := ”;
// Add the field names from the table.
outputMemo.Lines.Add(String.Format(‘|%8s|%-25s|%-25s|’, [‘ ID ‘, ‘ NAME >’,
‘ DEPARTMENT ‘]));
// Add one line to the memo for each record in the table.
while not query.Eof do
begin
outputMemo.Lines.Add(String.Format(‘|%8d|%-25s|%-25s|’,
[query.FieldByName(‘ID’).AsInteger, >query.FieldByName(‘Name’).AsString,
query.FieldByName(‘Department’).AsString]));
query.Next;
end;

finally
query.Close;
query.DisposeOf;
end;

end;

this is the code to display the database, i want to know if there’s a way to write on the memo or a TEdit and press a button to change back the database, i’m wondering if it works both ways.

Comments are closed.