Solved

Am I missing a database update?

Posted on 2004-03-25
5
209 Views
Last Modified: 2010-05-19
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)
0
Comment
Question by:mikelittlewood
  • 3
  • 2
5 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 10677834
yep, seems that a commit is missed
0
 
LVL 15

Author Comment

by:mikelittlewood
ID: 10678827
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
 
LVL 15

Author Comment

by:mikelittlewood
ID: 10678856
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
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 10679658
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
 
LVL 15

Author Comment

by:mikelittlewood
ID: 10679802
Got it working :)

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

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question