Subject | Re: [IBO] How to commit an update from code? |
---|---|
Author | Don Gollahon |
Post date | 2004-04-02T22:17:21Z |
""Eric Tishler"" <etishler@...> wrote in message
news:<9211DBA76BE969418E127E8F8C718C5815C5CB@...>...
don't need it.
least that's what I leave it at. I use an IB_Connection object.
Right-click on it go to the Transaction tab and set the Isolation level
to "Committed (Read Committed)".
If that doesn't help then add a
"ib_connection1.DefaultTransaction.Commit" after the query execute.
gollahon@...
"The Original GenSoft Prodigal"
news:<9211DBA76BE969418E127E8F8C718C5815C5CB@...>...
> I am running an update query in code. I construct the query manuallyApplyupdates is only needed when CachedUpdates is true. Normally you
> and then run it using ExecSQL. But the update never seems to take
> place
>
> This is my code (where qryTemp is a TIB_Query)
>
> With DataAccessMod.qryTemp do
> Begin
> Active := False;
> SQL.Clear;
>
> // construct the query
> SQL.Add('UPDATE "UserAccounts" SET ');
> SQL.Add('"Credits" = ' + IntToStr(iAmount) + ' ');
> SQL.Add('WHERE "AccountID" = ' + IntToStr(iUserID));
>
> // run the query
> ExecSQL;
>
> // After doing this I have tried each of the following: (one at a
> time)
>
> ApplyUpdates;
don't need it.
>CommitAction should be set to the default of caClose on your object. At
> CommitAction := caRefresh;
>
> CommitAction := caClose;
least that's what I leave it at. I use an IB_Connection object.
Right-click on it go to the Transaction tab and set the Isolation level
to "Committed (Read Committed)".
If that doesn't help then add a
"ib_connection1.DefaultTransaction.Commit" after the query execute.
> End;Don Gollahon
>
> But there are no changes to the Credits field in the UserAccounts
> table.
>
> Can somebody help me?
>
> Thank you,
>
> Eric
>
> Eric Tishler
> Software Architect
> Resolute Partners, LLC
> Phone: 203.271.1122
> Fax: 203.271.1460
> etishler@...
>
gollahon@...
"The Original GenSoft Prodigal"