Yes to both of your questions. I have already posted that the problem was that my update was not being committed. My AutoCommit property for my TIB_Transaction was set to false. Once I set this to true everything worked perfectly.
Good suggestions on your part never the less. Regards, Eric Eric Tishler Software Architect Resolute Partners, LLC Phone: 203.271.1122 Fax: 203.271.1460 [EMAIL PROTECTED] -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bevan Edwards Sent: Saturday, April 03, 2004 5:48 PM To: NZ Borland Developers Group - Delphi List Subject: Re: [DUG] How to commit and update using TIB_Query from code Hi Eric, Have you tried viewing/printing the value of SQL.Text to see the resulting SQL statement that is being executed? Does the user you are logged in as have permission to execute the query? Regards, Bevan ----- Original Message ----- From: "Eric Tishler" <[EMAIL PROTECTED]> To: "NZ Borland Developers Group - Delphi List" <[EMAIL PROTECTED]> Sent: Saturday, April 03, 2004 9:33 AM Subject: [DUG] How to commit and update using TIB_Query from code > I am running an update query in code using Delphi 6 and IB Objects. I construct the query manually 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; > > CommitAction := caRefresh; > > CommitAction := caClose; > End; > > I do not throw any exceptions, but the Credits field in the UserAccounts table remains unchanged, even though the value of iAmount is new. > > Can somebody help me? > > Thank you, > > Eric > > > Eric Tishler > Software Architect > Resolute Partners, LLC > Phone: 203.271.1122 > Fax: 203.271.1460 > [EMAIL PROTECTED] > > > > _______________________________________________ > Delphi mailing list > [EMAIL PROTECTED] > http://ns3.123.co.nz/mailman/listinfo/delphi > _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi
