Lazarus

Programming => Databases => Topic started by: Ati on July 19, 2006, 10:28:34 am

Title: Can´t write in Firebird
Post by: Ati on July 19, 2006, 10:28:34 am
Hi,

i want to write a little simple program which save three dates in a Firebird-DB. I have a trigger which before insert the ID by one increases. After i clicked the Save-Button the ID is increased by one but the table is empty??????????? I properties seems to be correctly. Here is my Code:
Code: [Select]
procedure TForm1.Button1Click(Sender: TObject);
begin
  qrmain.SQL.Text:='Insert into test (PLZ,ORT,TOUR) VALUES ('''+ed1.Text+''','''+ed2.Text+''','''+ed3.Text+''');';
  qrmain.ExecSQL;
end;

I don´t found any error. Can you help me??

Sorry for my bad english
Title: RE: Can´t write in Firebird
Post by: Marc on July 19, 2006, 11:12:46 am
I'm not sure if FB uses transactions by default, so maybe you need to commit your data
Title: Can´t write in Firebird
Post by: Ati on July 19, 2006, 11:21:38 am
That´s right Marc. I found the right Thread in this forum. Here is the right code
Code: [Select]
qrmain.SQL.Clear;
  qrmain.SQL.Text:='Insert into test (PLZ,ORT,TOUR) VALUES ('''+ed1.Text+''','''+ed2.Text+''','''+ed3.Text+''');';
  qrmain.ExecSQL;
  trmain.Commit;


Thank´s