Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

nuAutonumber not working

Questions related to using nuBuilder Forte.
Post Reply
Ewald
Posts: 11
Joined: Sat Dec 21, 2019 8:34 pm

nuAutonumber not working

Unread post 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?
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: nuAutonumber not working

Unread post 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.
Ewald
Posts: 11
Joined: Sat Dec 21, 2019 8:34 pm

Re: nuAutonumber not working

Unread post 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.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: nuAutonumber not working

Unread post 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.
Ewald
Posts: 11
Joined: Sat Dec 21, 2019 8:34 pm

Re: nuAutonumber not working

Unread post by Ewald »

Thanks, it works this way.
Post Reply