Page 1 of 1

How to Convert execute from SQLConnection to MyConnection

Posted: Sun 19 Apr 2009 19:12
by JiguJigu
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]

Posted: Tue 21 Apr 2009 08:53
by Dimon
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.