nuAutonumber not working

Questions related to using nuBuilder Forte.

nuAutonumber not working

Postby Ewald » Mon Dec 23, 2019 10:56 pm

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?
Ewald
 
Posts: 11
Joined: Sun Dec 22, 2019 5:04 am

Re: nuAutonumber not working

Postby kev1n » Tue Dec 24, 2019 2:45 am

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.
kev1n
 
Posts: 557
Joined: Mon Oct 15, 2018 2:13 am

Re: nuAutonumber not working

Postby Ewald » Tue Dec 24, 2019 8:43 pm

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.
Ewald
 
Posts: 11
Joined: Sun Dec 22, 2019 5:04 am

Re: nuAutonumber not working

Postby kev1n » Tue Dec 24, 2019 10:05 pm

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.
kev1n
 
Posts: 557
Joined: Mon Oct 15, 2018 2:13 am

Re: nuAutonumber not working

Postby Ewald » Wed Dec 25, 2019 9:32 pm

Thanks, it works this way.
Ewald
 
Posts: 11
Joined: Sun Dec 22, 2019 5:04 am


Return to General