Forum > Databases

firebird wirte in database

(1/1)

christian ortiz:
Hello, i use Lazarus 0.9.7  (July 2) )on Linux Mandriva, i can conect my database (firebird) and i  see all fields, then i compile and i add data to my fields (looks like it added) and then, i close my app, and i start it again, and see my fields are empty ¿?¿? how can i solve it.

i use SQLdb

cpal
Arequipa - Perú
PD: Sorry for my bad english
** La mejor manera de aprender es equivocandose**, creo que me equivoque

matthijs:
If you post your code, we could have a look at it. Right now we can only guess. :)
I'm using something like this:

--- Code: ---
begin
  { The SQLQuery in Lazarus does work with parameters yet, so }
  { we build the SQL statement completely.                      }
  SQLQuery2.SQL.Text := ' update CUSTOMER set'#10 +
                        ' CUSTOMER = '''       + LabeledEdit2.Text + ''','#10 +
                        ' CONTACT_FIRST = '''  + LabeledEdit3.Text + ''','#10 +
                        ' CONTACT_LAST = '''   + LabeledEdit4.Text + ''','#10 +
                        ' PHONE_NO = '''       + LabeledEdit5.Text + ''','#10 +
                        ' ADDRESS_LINE1 = '''  + LabeledEdit6.Text + ''','#10 +
                        ' ADDRESS_LINE2 = '''  + LabeledEdit7.Text + ''','#10 +
                        ' CITY = '''           + LabeledEdit8.Text + ''','#10 +
                        ' STATE_PROVINCE = ''' + LabeledEdit9.Text + ''','#10 +
                        ' POSTAL_CODE = '''    + LabeledEdit11.Text + ''','#10 +
                        ' COUNTRY = '''        + LabeledEdit10.Text + ''''#10 +
                        ' where CUST_NO = '  + LabeledEdit1.Text;
  SQLQuery2.ExecSQL;
  TSQLTransaction(SQLQuery2.Transaction).Commit;
end;

--- End code ---

In know this is a update statement, but the same goes for an insert statement. :)

Marcin Misiak:
I'm just doing this:
1. add sqlquery, ibconnect, transaction, datasource. sqlquery1 set sql (e.g. select * from employee)
2. add grid (or dbedit or other dbcontrols)
3. add dbnavigator
4. code

form1.onDestroy :
transaction.commit;
sql.close;
ibconnection.close;

button OK:

sql.applyupdates;

--------------------------
thats very simple and fast code :)

Navigation

[0] Message Index

Go to full version