Page 1 of 1

Error on Tstringfield on XE4

Posted: Fri 24 May 2013 03:17
by maubuso
Hi.

I'm having a problem with TStringField on XE4.

In a varchar(20) field, when I run the program, I receive this error :

Project ListaMoradores.exe raised exception class EDatabaseError with message 'dtsMoradores: Type mismatch for field 'LABEL', expecting: String actual: WideString'.

If I run with XE4 Firebird driver, the error not occurs .

Re: Error on Tstringfield on XE4

Posted: Fri 24 May 2013 03:21
by maubuso
Same problem occurs on XE3 update 2

Re: Error on Tstringfield on XE4

Posted: Fri 24 May 2013 06:37
by AndreyZ
Hello,

To solve the problem, you should set the UseUnicode parameter of TSQLConnection to False. You can set it in design-time, or in run-time using the following code:

Code: Select all

SQLConnection.Params.Values['UseUnicode'] := 'False';

Re: Error on Tstringfield on XE4

Posted: Fri 24 May 2013 14:47
by maubuso
Thanks Andrey. It worked!

One consideration : On 4.2.3 version, the driver not put on default params the UseUnicode on list.

Thanks.

Re: Error on Tstringfield on XE4

Posted: Mon 27 May 2013 07:24
by AndreyZ
Thank you for the information. We added the UseUnicode parameter to the default parameter list.