Am I missing a database update?

Im using interbase as my back end db.

Im updating a record using a TIBQuery, setting the params and using ExecSQL command to execute it.
The record seems to be updating in the grids etc I am using, but when I use another query to retrieve data fom the table Ive updated it doesnt seem to be there.
If I shut the program down again and restart, the information then appears.

Im not using cached updates.

Whe I use the execsql, do I need to apply/commit somewhere?
I cant do applydates on the dataset as it is closed (just using execsql command to update)
LVL 15
mikelittlewoodAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
kretzschmarConnect With a Mentor Commented:
sorry for delay, was absent

usual u have three components

IBDatabase -> for connection
IBTransaction -> for TransactionControl
IBQuery -> for DDL/DML SQL-Statements

simplest use

IBQuery.ExecSQL;
IBTransaction.Commit;  

// IBTransaction must assigned at the property Transaction of the IBQuery
//usual an assgniment should be enough to commit automatically
//if the properties of the IBTransaction are left as default
//<-- means no explicit commit must be done

hope thats it

meikl ;-)
0
 
kretzschmarCommented:
yep, seems that a commit is missed
0
 
mikelittlewoodAuthor Commented:
hmm ...

what part of the code needs the commit?
If I put it after execsql it won't compile.
Which object needs the .commit?
Or is there a commit setting on the object Im missin?
0
 
mikelittlewoodAuthor Commented:
I thought if your query is just -

update TABLE set blah blah blah

- then execsql would just update the record and commit automatically (bearing in mind no cache updates)
0
 
mikelittlewoodAuthor Commented:
Got it working :)

thx again ... I just need that odd poke in the right direction sometimes :)
0
All Courses

From novice to tech pro — start learning today.