Announcement

Collapse
No announcement yet.

Handling database errors

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Handling database errors

    I wonder if anybody has managing database errors. For example: I add a new record which is set UNIQUE attribute in the table. The database (in my case MySQL) generates an error (along with the Errorcode() ) and SC App - pops up a message like the one below.

    ErrorCode.png


    I would like to replace this message with my own (custom message).
    In this case I would like to read the Errorcode() from MySQL and based on that display Message(1) OR Message(2) if the code is different.
    I looked up the MACRO HELP but the descriptions are all garbage. It seems like the one who wrote the help for macro was drunk!
    BTW. I need to read the database ErrorCode() NOT the ErrorString() and based on that display proper message. This seem to be super simple to do but somehow SC does not handle SQL errors very well and the customization is inconvenient.


    Any tips how to do it ?
    TNX


    -----------------------------------------
    Arthur Klisiewicz
    dATA POINT SOFTWARE
    www.datapointsoftware.com

  • #2
    Hello aka.... have you tried this?....



    messages.png

    Comment


    • #3
      I haven't tried this, thanks. This seem to be somewhat helpful but does not provide any user interaction. I would like to be able user to resond (ie.e YES/NO or OK/CANCELL). I think having a Macro would be very helpful. I would love to see something like:

      sc_dberror(Parameter1, Param2) where Param1 is database Errornumber()

      Another problem is that this simple error handling is available only for forms while there is no way to do the same for other Apps :-(

      ARTHUR
      Last edited by aka; 06-30-2016, 02:24 AM.
      -----------------------------------------
      Arthur Klisiewicz
      dATA POINT SOFTWARE
      www.datapointsoftware.com

      Comment


      • #4
        agreed:

        There another problem it should have an option like "Redirect in case of error". Dont you think?

        Regards

        Comment


        • #5
          Yes I agree ! So far database errors are left completely alone and this becomes urgent.
          -----------------------------------------
          Arthur Klisiewicz
          dATA POINT SOFTWARE
          www.datapointsoftware.com

          Comment

          Working...
          X