Delphi Firedac - Case Sensitive issue
Asked Answered
P

3

12

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?

Pursuance answered 25/7, 2014 at 16:14 Comment(4)
Have you tried to set the FDConnection property 'MetaCaseIns' to true?Feasible
Yes, but didn't work. When I setted up the property 'MetaCaseIns' to true, the firedac component changed the database name to upper case. I need that the database name stay like typed.Pursuance
I'm send link to this topic immediately to the FireDAC's author, hope he'll say something.Felipa
Generally, if you troubled with FireDAC, you can try to ask at sql.ru/forum/1008012/firedac, English would be understood.Felipa
B
2

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;
Bil answered 14/7, 2017 at 1:12 Comment(1)
@Dreamer64, could you elaborate, ideally with MCVE in a separate question, please?Bil
P
0

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).

Pimple answered 26/3, 2015 at 15:42 Comment(0)
P
0

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;
Pontianak answered 31/7, 2017 at 15:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.