Using Transactions with MySQL and Delphi
Posted: Tue 02 Aug 2011 13:02
Hi all,
I have just downloaded the evaluation of MyDAC with the aim to upgrade a Delphi application from Interbase to MySQL.
The method in which Transactions are used appears to differ though. Based on the existing code, the translation should be:
As TMyCommand does not appear to have "Transaction" available, how can ths be done?
Thanks,
James
I have just downloaded the evaluation of MyDAC with the aim to upgrade a Delphi application from Interbase to MySQL.
The method in which Transactions are used appears to differ though. Based on the existing code, the translation should be:
Code: Select all
xTransaction := TMyTransaction.Create(nil);
xMyCommand := TMyCommand.Create(nil);
xMyCommand.Connection := MyConnection1;
xMyCommand.Transaction := xTransaction;
xTransaction.StartTransaction();
xMyCommand.SQL.Add('INSERT INTO TBL (A,B) VALUES ("1", "2")');
xMyCommand.Prepare();
xMyCommand.Execute();
xTransaction.Commit();Thanks,
James