#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
    3

    Implicit sql POST command


    I'm using Delphi XE version 15.0.3890.34076.

    I'm testing a legacy application that hits an INSERT sql command in a TADOQuery and lately after some processing it will hit a POST sql command. The method BeforePost is been fired before the POST command been executed.

    How can I discover which is the cause? Or... Someone here knows a list of command sequences that can force a implicit POST command? Or..

    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
    356
    Rep Power
    7
    Originally Posted by nightrider43
    I'm using Delphi XE version 15.0.3890.34076.

    I'm testing a legacy application that hits an INSERT sql command in a TADOQuery and lately after some processing it will hit a POST sql command. The method BeforePost is been fired before the POST command been executed.

    How can I discover which is the cause? Or... Someone here knows a list of command sequences that can force a implicit POST command? Or..

    Greetings from São Paulo - Brazil

    Ricardo
    You can take advantage of the beforepost method yourself to notify you of when a POST is about to happen. Just put as the first line a showmessage('posting'); Of course that isn't production code, but could be useful in testing.

    As to what can cause an implicit post. Simply moving to a new record if the current record is being edited (table.state = dsedit) will cause Delphi to post the current values to the record. That is one of the main reasons my db applications either work on 1 record at a time (can't move between records when the data set consists of one record), or the dataset is readonly.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Location
    São Paulo - Brazil
    Posts
    35
    Rep Power
    3
    I was detecting the implicit post rightly with a break point in the beforepost method.

    It seems that it was a kind of corruption in deplhi's generated code. After close and open Delphi XE IDE the trouble no longer occurs.

    Thank you very much for your explanation. I learn much about implicit post causes.

    Cheers

IMN logo majestic logo threadwatch logo seochat tools logo