unknown type on auto inc key field
unknown type on auto inc key field
After upgrading to MyDac 7.2.7 from 6.10.0 I get 'unknown type' errors on the auto-increment key fields when linked client datasets are opened.
All dcu's deleted before rebuild.
Key fields: int(10) or smallint(5), auto inc, not null, PK, unsigned
Config:
Win 7 64bit Ultimate
Delphi XE Version 15.0.3953.35171
MySql v5.0 running on CentOS 5.4 VM
structure:
MyConnection
MyQuery
Dataset Provider
Client Dataset
Connection opens OK
MyQuery opens OK and can edit data within the component at design-time
Client Dataset - check 'active' displays the key field name and 'unknown type'
uninstalling MyDac7 and re-installing MyDac6 clears the problem and the program runs fine.
All dcu's deleted before rebuild.
Key fields: int(10) or smallint(5), auto inc, not null, PK, unsigned
Config:
Win 7 64bit Ultimate
Delphi XE Version 15.0.3953.35171
MySql v5.0 running on CentOS 5.4 VM
structure:
MyConnection
MyQuery
Dataset Provider
Client Dataset
Connection opens OK
MyQuery opens OK and can edit data within the component at design-time
Client Dataset - check 'active' displays the key field name and 'unknown type'
uninstalling MyDac7 and re-installing MyDac6 clears the problem and the program runs fine.
-
AndreyZ
Re: unknown type on auto inc key field
Hello,
In the latest MyDAC version 7.2.7 we added the new functionality - data mapping, that allows mapping of server data types to IDE types. To fully support data mapping, we made several changes in field creation that also slightly increase performance. In MyDAC 7.2.7 for the MySQL type INT UNSIGNED the TLongWordField field is created. To return the old behaviour, you should add the following mapping rule:After this, for the MySQL type INT UNSIGNED the TLargeintField field will be created. This will solve the problem. Please note that to use the myIntUnsigned variable, you should add the MyDataTypeMap unit to the USES clause of your unit.
In the latest MyDAC version 7.2.7 we added the new functionality - data mapping, that allows mapping of server data types to IDE types. To fully support data mapping, we made several changes in field creation that also slightly increase performance. In MyDAC 7.2.7 for the MySQL type INT UNSIGNED the TLongWordField field is created. To return the old behaviour, you should add the following mapping rule:
Code: Select all
MyConnection.DataTypeMap.AddDBTypeRule(myIntUnsigned, ftLargeint);Re: unknown type on auto inc key field
Almost works, the unknown type error no longer appears but I get an access violation.
The issue is my use of tiny, small and large unsigned integer fields in the database.
My solution is to use the DataTypeMap editor on the component
field1 > word
field2 > word
dbtype tinyint unsigned > boolean
dbtype smallint unsigned > smallint
dbtype integer unsigned > largeint
it is fairly intuitive but a little help would be good. (I can't find it in the MyDac help installed in Delphi).
Thanks
The issue is my use of tiny, small and large unsigned integer fields in the database.
My solution is to use the DataTypeMap editor on the component
field1 > word
field2 > word
dbtype tinyint unsigned > boolean
dbtype smallint unsigned > smallint
dbtype integer unsigned > largeint
it is fairly intuitive but a little help would be good. (I can't find it in the MyDac help installed in Delphi).
Thanks
-
AndreyZ
Re: unknown type on auto inc key field
You can download the updated MyDAC documentation in the CHM and PDF formats here (in the "Documentation and Demo" section): http://www.devart.com/mydac/download.html . In the updated MyDAC documentation you will find the "Working with Data Type Mapping" article that describes the "Data Type Mapping" feature in details.
Re: unknown type on auto inc key field
Thanks - I should have scrolled down the page further!
That is all for this thread, hopefully it will be useful to others too.
Thanks for your help.
That is all for this thread, hopefully it will be useful to others too.
Thanks for your help.
-
AndreyZ
Re: unknown type on auto inc key field
Feel free to contact us if you have any further questions about MyDAC.
Re: unknown type on auto inc key field
Just to let you know...AndreyZ wrote:You can download the updated MyDAC documentation in the CHM and PDF formats here (in the "Documentation and Demo" section): http://www.devart.com/mydac/download.html .
The MyDAC documentation PDF file has "UNREGISTERED VERSION OF CHM TO PDF CONVERTER STA" watermarked over every other page in big red letters - about 1230 times, if I am doing the math correctly.
This is pretty annoying.
Best regards,
Kevin G. McCoy
-
AndreyZ
Re: unknown type on auto inc key field
We already fixed the problem with all DAC products' documentation. The next DAC builds will not have this problem with the documentation.