This topic is locked

error when 'adding record'

11/29/2006 8:20:25 PM
PHPRunner General questions
J
jmmarrs author

I'm trying to add a record to a single table which has only one Key/Index called RecID and is an auto-increment field. I have 150 records in the table and I get the error:
<<< Record was NOT added >>>

"Duplicate entry '150' for key 1
There are no other "must be unique" fields in the structure.
Since I'm really less than a "rookie or newbie" with any and all of this I'm confused. The code that is failing was generated shortly before your recent 170 build. I have done a quick and dirty new project from the new 170 build which doesn't include some of the logon stuff and various views that the failing (in-use and active) project uses, and it successfully added a record. I'm reluctant to re-build the failing system with the 170 build since for me that would be a shot-in-th-dark. This is a live-production system that I thought you might give me a little guidence on before I start 'shooting'. Everything else (edit, view, list, logon, some events to write a logon table... etc) seem to be working just fine. Only Add is failing.
Again... I got 'Add' to work but only with a stripped down 170 build.. and what's happening may not be related to any "bug" fix in 170. I simply don't know where to start looking.

Sergey Kornilov admin 11/29/2006

To let auto-increment field do it's job remove this field from the Add page. Also make sure this field don't participate in master-detail relationship or in advanced security settings.

L
lawfour 11/29/2006

I get this error only when I set the advanced security with primary key on both sides.
I think u may have setting like this:
Advanced Settings:
Users table: OwnerID field = LoginID

Main Table: OwnerID Field = RecID
If you change the setting from primary key to field on both sides it should work at least it worked for me.
example: on the advanced settings I use this:
Users table: OwnerID field = Username

Main Table: OwnerID Field = Name
Of course you can use any field that you have listed that represents each other for me Username is tied into Name of user.
Hope this helps

L

J
jmmarrs author 12/1/2006

OK... thanks!
I think I figured it out. I had the auto-increment field (the RecID) specified and it was trying to load that value (which happened to be '150') the new records' RecID field which was an auto-increment and of course it already existed.
All is working fine now..
thanks again