#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Location
    São Paulo - Brazil
    Posts
    35
    Rep Power
    2

    Disable the delete of a DBNavigator


    I would like to use the Delete button of TwwDBNavigator to run a routine that sets a flag(a column of a SQL table) of logical deletion to on.

    I can put code on BeforeDelete and AfterDelete methods of the associated TADOConnection. My trouble is to avoid that the associated database record been deleted.

    Would someone here know how I can do this?

    Greetings from São Paulo - Brazil

    Ricardo
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    355
    Rep Power
    7
    You should be able to abort the operation in the beforedelete method
    Code:
    begin
       <tablename>.edit;
       <tablename>.FieldByName('<Logical Field Name>').Value := <new Value>;
       <tablename>.Post;
       Abort;
    end;

IMN logo majestic logo threadwatch logo seochat tools logo