FireDAC dataset (FDQuery) problem - database with . (dot) in it's name

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
michal.bak
Posts: 2
Joined: Tue 10 Apr 2018 15:26

FireDAC dataset (FDQuery) problem - database with . (dot) in it's name

Post by michal.bak » Tue 10 Apr 2018 15:40

Hi all,

I have got this problem with FireDAC -> FDQuery component when it tries to select data from a database with '.' (dot) in its name.

The database name is TEST_2.0 and the error on Opening the dataset says
'Could not find server 'TEST_2' in sys.servers [...]'.

I have tried {TEST_2.0} (curly brackets) and [TEST_2.0] (square brackets). Also setting QuotedIdentifiers property to True does not seem to fix the problem. In SQL query I can add 'SET QUOTED_IDENTIFIER ON;' but this breaks inserts to the dataset.

The FDConnection component can connect to that server and that database using MSSQL driver without problems. It seems it is the dataset that dosn't handle it. UniDAC seems to handle everything without any problems.

I am using RadStudio 10.2.

has anyone found any solution to this? Thanks in advance for any replies.

michal.bak
Posts: 2
Joined: Tue 10 Apr 2018 15:26

Re: FireDAC dataset (FDQuery) problem - database with . (dot) in it's name

Post by michal.bak » Wed 11 Apr 2018 14:19

I think I have got a workaround:

I got a response from Emarcadero and it works for me:

"The problem is not in FireDAC, but in SQL Server ODBC driver SQLPrimaryKeys function. It fails to work with a catalog name containing a dot. FireDAC uses this function to get primary key fields for a result set, when fiMeta is included into FetchOptions.Items. So, as a workaround / solution, please exclude fiMeta from FetchOptions.Items."

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: FireDAC dataset (FDQuery) problem - database with . (dot) in it's name

Post by Stellar » Thu 12 Apr 2018 12:14

Please specify whether you are using Devart ODBC Driver for SQL Server or Microsoft ODBC Driver for SQL Server. To avoid similar issues, use UniDAC instead of FireDAC.

Post Reply