//this is what I do on creating the form
DBConnection.Connected := True;
SQLTransaction1.Active := True;
SQLQuery1.Open;
//this is the basics of the function I use to write into the DB
SQLQuery1.SQL.Text := 'INSERT INTO db (sensor) values (:PH_val)';
SQL.Query1.Params.ParamByName('PH_val').AsInteger := 2
SQLQuery.ExecSQL;
SQLTransaction1.Commit;
//this is the basics of the function I use to filter and display the valus in a grid
SQLQuery1.SQL.Text := 'select * from db';
SQLQuery1.Open;
SQLQUery1.Applyupdates;