NetTalk Central

Author Topic: Bizarre way to get MySql AutoIncrement to work....  (Read 1755 times)

jorgemir

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
    • Email
Bizarre way to get MySql AutoIncrement to work....
« on: April 27, 2009, 08:03:15 PM »
Hi. Some time ago I posted this question on the forum. At the time there where no solution and I went into other chores. Now, I'm working again on the subjet. A form won't let you insert a record with an autoincrement field. Problem is: Valid values can not be zero or blank, and you can not give it a value because it must go with zero value to the MySql database in order to get autoincremented. Gray hair until I casually discovered tha priming the field with -1 actually do works Ok. Record is entered with right next autoincrement value and everything is ok.
I don't know real mechanism of this behavior. Maybe next NTWS version won't budge, but right now, with PR35 is working.
Cheers.
Jorge


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: Bizarre way to get MySql AutoIncrement to work....
« Reply #1 on: April 27, 2009, 09:43:01 PM »
Hi Jorge,

Sounds like you've got the field set as "cannot be zero or blank" set in your dictionary. That would be where the NT validation comes from.

The -1 setting is a neat trick though, and one well worth knowing for MySql.

Cheers
Bruce