FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Delete a record ? To Mr. Rao
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Delete a record ? To Mr. Rao
Posted: Sun Jul 18, 2021 04:14 PM
Mr. Rao:

currently I use the following code to delete a record in a table

Code (fw): Select all Collapse
      cCmdSql  := "DELETE FROM " +;
                     "HdrPro " +;
                  "WHERE " +;
                     "HDR_PRO = " + Str(oRsHdr:Fields("HDR_PRO"):Value,05,0)
      TRY
         oApp:oCon:Execute(cCmdSql)
      CATCH oError
         MsgInfo("No pude ejecutar el comando " + cCmdSql,oApp:cAplicacion)
         FW_ShowAdoError(oApp:oCon)

            cCmdSql := "ROLLBACK"
            TRY
                oApp:oCon:Execute(cCmdSql)
         CATCH oError
                MsgInfo("No pude ejecutar el comando " + cCmdSql,oApp:cAplicacion)
         END
      END


Or

Code (fw): Select all Collapse
       oRsHdr:Delete()


is there a shorter code to do the same?, I mean in your FWFuncs.

With best regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero

Continue the discussion