September 12th, 2013, 04:07 AM
DAtabase and data fields
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.
September 12th, 2013, 04:36 AM
a small clarification, the error is displayed: "Maximum valididy check failed, field: 'Reference' ".
September 20th, 2013, 04:58 AM
No ideas for me?
September 20th, 2013, 10:31 AM
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.
September 23rd, 2013, 05:56 AM
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
September 23rd, 2013, 08:57 AM
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.
Originally Posted by IgorG
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.
September 23rd, 2013, 11:49 AM
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?
September 23rd, 2013, 12:06 PM
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.
September 24th, 2013, 04:39 AM
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!
September 24th, 2013, 09:04 AM