Page 1 of 1

Error Message with duplicate key

PostPosted: Tue Jul 10, 2007 1:17 pm
by carlos torres
Hi everybody

I create a table with an specific field as key.

When i test it duplicating the key dbp detect the duplicate record/key warning with a message.

i change the value and try to move forward/backward and dbp still remain with the last warning.... but when i restart the app the record was added to the table or the value is right.

it's a little bug?

regards

PostPosted: Tue Jul 10, 2007 5:49 pm
by Neosoft Support
About 90% of the error messages you see are generated by the database engine, so I'm not sure exactly how best to handle situations like this. What the database is saying is that your edits violate the table's constraints. Different databases handle this error differently with different error messages.

Can you tell us what type of database you're using and what actions you took to duplicate a key and trigger the error?

About warnings

PostPosted: Tue Jul 10, 2007 6:19 pm
by carlos torres
Dear Neosoft

I'm trying to use DB Access.
Code: Select all
dbpCreateAccessDatabase "[PubDir]DbLst.MDB" "Password=;Encrypted=Yes"
   dbpOpenAccessDatabase "DBLst" "[PubDir]DbLst.MDB" ""
   dbpCreateTable "DbLst" "Student" "Code String(15) PrimaryKey;LastName String(35);Names String(35)"


I'm still trying to understand the dbp behavior when handle db access...
1 - the parameter "encrypted" affect to whom? the data remains without change.
2 - when I delete all the records, nbp warns "dataset not in edit or insert mode"... How can I change this state.

regards
carlost

PostPosted: Wed Jul 11, 2007 10:28 am
by Neosoft Support
1 - the parameter "encrypted" affect to whom? the data remains without change.


The Encrypted=Yes option physically encrypts the data stored inside the database. If you examine an encrypted database with a hex editor you will see that the data is not visible. The data in an unencrypted database can be viewed with a hex editor. Of course, an encrypted database without a password doesn't really do any good. To actually protect the database, you must use both encryption and a password.

2 - when I delete all the records, nbp warns "dataset not in edit or insert mode"... How can I change this state.


I wasn't able to reproduce the problem you described with the DeleteAll action. However, when using Text Entry Fields I was able to reproduce the problem you described with the duplicate key. This will be fixed before the final release.

One other thing I noticed with your sample code, was that you're using the reserved word "Names" as one of your field names. When I tried to run your create table code, I received an error message. Renaming the Names field to aNames solved the problem.

PostPosted: Fri Jul 13, 2007 5:30 pm
by Neosoft Support
Carlos:

DBPro beta 2.3 should correct the duplicate key problem you reported.

http://www.neosoftware.com/forum/viewtopic.php?t=15314

Can you test it and let us know?