Page 1 of 1

varchar replaced by nvarchar

Posted: Mon 20 Sep 2010 10:46
Hello,

The Params.ParamByName('Code').AsString is changed form varchar to nvarchar. This causes for selections like

WHERE Code LIKE '186484.25'

to return no rows. The param is represented as nvarchar(9). This used to be varchar(9) and with varchar it returns the rows needed.

Is there an option to change it back again to varchar?

Kind Regards,

Michel

Posted: Tue 21 Sep 2010 06:41
by AndreyZ
Hello,

Please, try to switch the UseUnicode param in the TSQLConnection.Params property. This param enables or disables Unicode support. When set to True, all character data from nchar and nvarchar columns is stored as WideStrings, and TStringField is replaced with TWideStringFiled.

Posted: Tue 21 Sep 2010 10:05
Tried:

Code: Select all

  SQLConnection.Params.Values[sUseUnicode] := 'False';
and

Code: Select all

  SQLConnection.Params.Values[sUseUnicode] := 'True';
Checked the value with

Code: Select all

  if TDBXDevartSQLServerProperties(SQLConnection.ConnectionData.Properties).UseUnicode then
and it was changed.

But param is still @P1 nvarchar(11). In all cases.

Other options? please help...

I read something about ParamStringAsAnsiString??

Kind regards,

Michel

Posted: Tue 21 Sep 2010 11:37
by AndreyZ
I could not reproduce the problem. Please send me a complete small sample to andreyz*devart*com to demonstrate the problem, including a script to create a table.
Also supply me the following information:
- the exact version of DbxSda;
- the exact version of your IDE.