Page 1 of 1

force TStringField instead TWideStringField

Posted: Fri 17 Aug 2012 07:41
by carlonarcisi
hello
I'm using Delphi XE2, last relese unidac 4.3.8
when I connect to a tables in a MS Access (access 2000 format) DB, when I add fields in fields editor all fields that are type TEXT are interpreted as TWideStringField.
I have the same DB on MSSQL and when I connect to the same table where the fields are varchar, the fields are interpreted as TStringField.
I tried to configure the dataTypeMap but I could not set it up to solve the problem .. or not this is the way.
i've tryed to set param "useUnicode" = FALSE in specificOptions in UniConnection .. but .. nothing

I understand that varchar does not support unicode for this reason is converted to TStringField that just does not support unicode.

This is why I was hoping to linking up with UseUnicode = FALSE in ACCESS options the fields would be converted into TStringField

the nice thing, If I connect to access database using D7 with unidac 4.2.7 fields are interpreted as TStringField and not as TWideStringField.

can you give some indication?
carlo narcisi

Re: force TStringField instead TWideStringField

Posted: Mon 20 Aug 2012 11:42
by AlexP
hello,

Thank you for the information. We've reproduced and fixed the problem. This fix will be included in the next build.
For the time being, you can use Data Type Mapping specifying the DB field name instead of its type, you'll get the correct result in this case.

Re: force TStringField instead TWideStringField

Posted: Mon 20 Aug 2012 12:08
by carlonarcisi
hi alex
i've 327 unit i've to convert and check .. and I'd rather do the job once and do it right
please, how is possible download the beta release ?
let me know

Re: force TStringField instead TWideStringField

Posted: Mon 20 Aug 2012 13:45
by AlexP
hello,

Please specify your license number and e-mail, in order that we can send you the fixed version of UniDAC for XE2

Re: force TStringField instead TWideStringField

Posted: Mon 20 Aug 2012 14:02
by carlonarcisi
thanks a lot !!!
license number is 02005.
carlo.narcisi*gmail*com

Re: force TStringField instead TWideStringField

Posted: Tue 21 Aug 2012 13:14
by AlexP
hello,

I send you a fixed AccessDataTypeMapUni unit to the specified e-mail

Re: force TStringField instead TWideStringField

Posted: Wed 22 Aug 2012 08:47
by carlonarcisi
hello alex
I replaced the unit that you gave me and I compiled all, but I get exactly the same results.
when I connect a string field is converted into TWideStringField and not TStringField
can you help me ?
carlo

Re: force TStringField instead TWideStringField

Posted: Wed 22 Aug 2012 09:08
by carlonarcisi
works!
did not tell me .. I write for other users

I added the following line on data type mapping:
database type: Text
Field Type: string

carlo

Re: force TStringField instead TWideStringField

Posted: Wed 22 Aug 2012 09:55
by AlexP
hello,

The field type doesn't change by default, however, now, when using DataTypeMapping, Text type fields can be mapped to the TStringField type in Delphi versions since 2009. To map Text fields to a needed type, you can set mapping globally at the TUniConnection level, and the set rule will be applied to all attached DataSets