Page 1 of 1

Autoinc problem

Posted: Sat 29 Oct 2016 18:26
by davor.TCS
I am using Delphi XE8, with MyDAC 8.7.25. I have wrong representation of AutoInc field in my table.
AutoInc field in MySQL is defined as tinyint(3) unsigned NOT NULL.
In DBGrid i get some strange values...
https://postimg.org/image/db5hka22b/
Probably some small thing I overlooked.

Re: Autoinc problem

Posted: Mon 31 Oct 2016 14:34
by ViktorV
Unfortunately, we could not reproduce the issue.
In order to get a detailed answer, please compose a small sample demonstrating the described behavior and send it using the contact form https://www.devart.com/company/contactform.html including scripts for creating database objects. Also, please specify the exact version of the used MySQL server.

Re: Autoinc problem

Posted: Wed 02 Nov 2016 18:40
by davor.TCS
Ok. Sent it to you with contactform...

Re: Autoinc problem

Posted: Thu 03 Nov 2016 14:25
by ViktorV
The issue is not related to the work of MyDAC, and it is connected with the peculiarities of IDE work with the fields type TUnsignedAutoIncField. This class is designed only to work with LongWord data type.
You can verify this by trying to connect to the database, using the standard FireDAC components.
To solve the issue, you can re-create a field of TUnsignedAutoIncField type on TAutoIncField or remove persistent fields.

Re: Autoinc problem

Posted: Sat 07 Jan 2017 19:56
by davor.TCS
I solved it like this:
- If they are unsigned in mysql field must be declared as mediumint, and in Delphi as TUnsignedAutoInc
- If it is signed then in mysql field must be declared minimum as mediumint or int, and in Delphi as TAutoInc

Perhaps there is a better way, but for my db this was quick fix.

Re: Autoinc problem

Posted: Wed 11 Jan 2017 08:58
by ViktorV
We are glad to know you have found a solution for the issue.
Feel free to contact us if you have any further questions about our products.