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.
FireDAC dataset (FDQuery) problem - database with . (dot) in it's name
-
- Posts: 2
- Joined: Tue 10 Apr 2018 15:26
-
- Posts: 2
- Joined: Tue 10 Apr 2018 15:26
Re: FireDAC dataset (FDQuery) problem - database with . (dot) in it's name
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."
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."
Re: FireDAC dataset (FDQuery) problem - database with . (dot) in it's name
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.