Hi Eric,

Your SQL statements look a little strange to me with the quotes etc. Are you commiting your update? I'm more familiar with IBX where I would use a leaner TIBSQL instead of a TIBQuery for an update or delete. Something like:

procedure TForm1.Button1Click(Sender: TObject);
begin
 IBTransaction2.StartTransaction;
 IBSQL1.SQL.Add('Update Office');
 IBSQL1.SQL.Add('Set OfficeName = ''Wellington''');
 IBSQL1.SQL.Add('Where OfficeID = 9');
 IBSQL1.ExecQuery;
 IBTransaction2.Commit;
end;

HTH,
Craig.

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;



_______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to