Recent

Author Topic: firebird wirte in database  (Read 4415 times)

christian ortiz

  • Guest
firebird wirte in database
« on: July 17, 2005, 06:51:15 am »
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

  • Hero Member
  • *****
  • Posts: 537
firebird wirte in database
« Reply #1 on: July 17, 2005, 09:42:01 am »
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: [Select]

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;

In know this is a update statement, but the same goes for an insert statement. :)
What's in a sig? Would my posting look less if it didnot have a sig? (Free after William S.) :)

:( Why cannot I upload my own Avatar? :(

Marcin Misiak

  • Guest
firebird made easy
« Reply #2 on: November 03, 2005, 08:27:07 pm »
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 :)

 

TinyPortal © 2005-2018