I am trying to migrate my application from ADO to FireDAC. I am using Microsoft SQL Server. My database server was installed with collation SENSITIVE CASE and the database was created with collation INSENSITIVE CASE. I did this configuration because my custumers has this configuration. But when I tried to migrate to FireDAC, the FireDAC driver (MSSQL) look the database collation and change the property "database name" to upper case. After that, many things didnt work, because the FireDAC didn't find the "database name" in sysdatabase. Can I turn off this function that change the "database name" property?
I guess you're looking for the MetaCaseInsCat connection parameter. Try to disable catalog names case sensitivity autodetection and set it up to be case insensitive:
...
FDConnection1.Params.Add('MetaCaseInsCat=True');
FDConnection1.Connected := True;
I find it that FireDAC is using ansi uppercase conversion to access the database, which in turn causes problems with MSSQL. In my case it was turkish. I found the fix to be easy. In OnBeforeConnect
of TFDConnection I used:
Params.Database := TRUpperCase(Params.Database);
Where TRUpperCase
is a function that properly converts turkish characters to uppercase(like i to İ, instead of i to I).
This is not a direct answer to the OP, but it may help future programmer like me who are having issue with case sensitivity in FireDAC
I'm using FireDAC with MSSQL. In order to use the 'LIKE' in a TFDQuery Filter in a non caseSensitive way : TFDQuery.FilterOptions
procedure TFDQuery_MyVersion.SetFilterText(const Value: string);
begin
FilterOptions := [TFilterOption.foCaseInsensitive];
inherited SetFilterText(TOldDatabaseSystemToMSSQL.Filter(Value));
end;
© 2022 - 2024 — McMap. All rights reserved.