Page 1 of 1

nuAutonumber not working

Posted: Mon Dec 23, 2019 2:26 pm
by Ewald
I have built a 'browse and edit' form to enter users into a database. Following the nuBuilderForte_UserGuide I can't make the nuAutonumber type working.
When creating the object (type set to input, input type set to nuautonumer, ID set to the primary key field of the database) I can't save it as long as the input type is set to autonumber.
If I set the input type to number, I can save it but then I can't enter a new record into the database.
What am I missing?

Re: nuAutonumber not working

Posted: Mon Dec 23, 2019 6:15 pm
by kev1n
You should not use an auto increment value as primary key.

The recommended table structure is described here:

https://wiki.nubuilder.net/nubuilderv3/ ... _Structure

Of course, you can add an additional field with type nuAutonumber.

Re: nuAutonumber not working

Posted: Tue Dec 24, 2019 12:13 pm
by Ewald
Thanks for your consideration.
My Problem will be that I want to use nuBuilder to access an already existing MySQL database. Thus the table structure is given and the primary key is defined as an autonumber value.
The table has the following structure: IDUser (prim., autonumber), FirstNameUser (Varchar), LastNameUser(Varchar). The 'browse and edit' form I built doesn't let me add new records.

Re: nuAutonumber not working

Posted: Tue Dec 24, 2019 1:35 pm
by kev1n
Don't create an object in nuBuilder for the primary key.
Then saving will work if there's a primary key with AUTO_INCREMENT in your table.

Re: nuAutonumber not working

Posted: Wed Dec 25, 2019 1:02 pm
by Ewald
Thanks, it works this way.