How to Convert execute from SQLConnection to MyConnection

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
JiguJigu
Posts: 5
Joined: Wed 17 May 2006 06:02

How to Convert execute from SQLConnection to MyConnection

Post by JiguJigu » Sun 19 Apr 2009 19:12

below is part of my program (using starndart dbexpress).
i wanna try using MyConnection.

what is similarity of "execute" in MyConnection (see execute sintax)

so i can get the failed value,
or
how i can get how many sqlstatment failed ?

thank's
Jigu

Code: Select all

   with sqlConnection1 do begin
          StartTransaction(Trans);
      try
          SQLstr:='Update table1 Set Fpost = 1  where Nomor = 432 ';
          SQLstr:='Update table2 set Fpost = 1 where nomor = 443'; 



          Failed := execute(SQLstr,Nil) < 1 ;


           if Not Failed then
                  Commit(Trans)
            else
                  Rollback(trans);
      except
            Rollback(Trans);
      end;
  end;
[/b]

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 21 Apr 2009 08:53

To execute any SQL statement from TMyConnection you can use the ExecSQL or ExecSQLEx methods.
You can find more detailed information about these methods in the MyDAC help.

Post Reply