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.
Autoinc problem
Re: Autoinc problem
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.
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
Ok. Sent it to you with contactform...
Re: Autoinc problem
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.
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
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.
- 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
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.
Feel free to contact us if you have any further questions about our products.