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

    Join Date
    Sep 2013
    Posts
    6
    Rep Power
    0

    DAtabase and data fields


    Hello,

    my name is Igor, i'm an young programmer in sens that are few times that i programming for work.

    I have an question on database's fields. I have an field defined by integer where i want put an number with 7 digits but the program raise error.

    Integer is 32 bit, i don't understand why i can't put a number higher than 999999.

    I check but i haven't find control on the entered values.

    There are an database limitation?
    How can i do to solve my problem?

    the code is very long and isn't written by me, i have to made only a modification for the client.

    Thanks you a lot.

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

    Join Date
    Sep 2013
    Posts
    6
    Rep Power
    0
    Sorry,

    a small clarification, the error is displayed: "Maximum valididy check failed, field: 'Reference' ".

    Thanks you

    Igor
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    6
    Rep Power
    0
    No ideas for me?

    Help
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    354
    Rep Power
    7
    You first need to figure out which layer (application, database) is responsible for raising the error.

    A quick check would be to add a row to the table directly through the database interface (if you use Oracle - use SQL Plus, if MS Access, open access and attempt to add a row to the table etc...).

    If you get this error when you try to enter the value directly through your database interface, then the database layer is responsible, if not, more than likely the Delphi application has some code doing data integrity checks BEFORE posting to the table.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    6
    Rep Power
    0
    First of all thanks for the reply.

    I understand that the database is Paradox, and I looked for a program with which i can open and i havo downloaded a "Paradox data editor".

    Also with this program when i try to put an reference with 7 digits raise error "maximum validity check failed field reference".

    Can i tell that the problem is a database?

    In this case i must to have an database editor to modify a field's properties. With Paradox Data Editor i'm not able to change a properties, i have tried in severals ways without succes.

    Thanks you in advance

    Igor
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    354
    Rep Power
    7
    Originally Posted by IgorG
    Also with this program when i try to put an reference with 7 digits raise error "maximum validity check failed field reference".
    It certainly does look like the constraint is at the database level. Delphi should have the "Database Desktop" (DD) available that can work with Paradox (and Interbase) databases, so I'd suggest looking at the table structure in the (DD) and if the constraint no longer makes sense, remove it.

    Also, once you make the actual changes to the database structure, you will still probably have to alter your Delphi application to read in the table's new structure. This will have to happen at every location in your application that accesses that field in the table.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    6
    Rep Power
    0
    Thanks a lot majlumbo.

    It's true also BDE has a database viewer and is the same as Paradox.

    I have found where are the validity check on fields but i cannot edit this value, and if i try to modify to false the check on field raise error (cannot edid Required).

    In this form is also showed a "Picture" where is showned the max digit of reference's field, and i can modify. Why?

    Thanks you

    Igor
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    354
    Rep Power
    7
    It has been many years since I have worked with BDE/Paradox. Can't say for sure if the BDE control panel applet allows you to modify the actual database, if it doesn't, that would explain why you can't. I'm assuming it's main functionality is to establish an alias for existing databases.

    Don't know which version of Delphi you have, but I suggest to search to see if you have the Database Desktop application as part of the Delphi installation. If there, you should have the ability to modify the database.

    One more word. I would highly suggest you make a complete backup of your database and your application before making any of your changes, if they aren't already part of a version control system.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    6
    Rep Power
    0
    Dear Majlumbo
    you are the best!!!

    Finally, with your aid, i have solved my problem.

    The solution is download Desktop Databese and open my database with this program. At this time Table -> Restructure and the user can modify the field's properties.

    Thanks you a lot!

    Have a nice day!

    Igor
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    354
    Rep Power
    7
    Glad it worked.

IMN logo majestic logo threadwatch logo seochat tools logo