Delphi 2010, Sql NVARCHAR and UniCode

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 1
Joined: Thu 15 Oct 2009 21:20

Delphi 2010, Sql NVARCHAR and UniCode

Post by 1378Support » Thu 15 Oct 2009 21:39

I need an option or solution for your component SDAC v4.80 with Delphi 2010

I am trying to migrate from Delphi 7 to Delphi 2010, but when I open a TMsQuery with a parameter assigned with AsString, the SDAC consider the value as NVARCHAR on Sql 2005/2008 but my fields in DB are VarChar. This cause some performance hits.

I need a property like UseUnicode = False for the connection that will affect the Params[x].AsString, and when the property is at False, the Sql query will use VarChar (like AsAnsiString). I can't use AsAnsiString because it will cause a lot of working to do it. (I can not replace everywhere when I see AsString because I must keep compatible the code with Delphi 7 and I have a lot of Params using by TClientDataSet.)

I already change the source in DB.pas from Delphi, but your component have is own Params and I don't have the source code to change it.

Could you help me to override your component or add the new property?


Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Fri 23 Oct 2009 08:52

We will add such option in the next build of SDAC.

Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 17 Nov 2009 14:32

To solve the problem you can use the DBAccess.ParamStringAsAnsiString variable.
This variable has sense for Delphi 2009 and higher.
Set its value to True to use the AsAnsiString property when setting the parameter value through TDAParam.AsString. Otherwise the AsWideString property is used. The default value is False.

Post Reply