Die Holländer 34 Posted Thursday at 09:32 AM Sometimes my users get an SQL error maybe because the computer doesn't have the proper ODBC driver version installed. (Like "ODBC Driver 17 for SQL server") How in runTime can I ask FireDac to fetch this driver version used by the application? I have the FDConnection open. Share this post Link to post
Lajos Juhász 289 Posted Thursday at 09:37 AM You can try this: https://stackoverflow.com/questions/42403351/how-can-i-find-the-ms-access-version-and-or-dll-name-used-for-a-firedac-connecti Share this post Link to post
Die Holländer 34 Posted Thursday at 09:57 AM I can't get the name like "ODBC Driver 17 for SQL server" but I see things like "17" by the statement under, so that will do.. Uses FireDAC.Phys.ODBCWrapper; SQLDriverName:=TODBCConnection(DatabaseConnectionObject.ADConnection.CliObj).DRIVER_NAME;//DRIVER_VER;// DRIVER_ODBC_VER; Share this post Link to post
Lajos Juhász 289 Posted Thursday at 10:44 AM TFDPhysMSSQLDriverLink has an ODBCDriver property, I have no server to test it. Share this post Link to post
Die Holländer 34 Posted Thursday at 12:01 PM 32 minutes ago, Lajos Juhász said: TFDPhysMSSQLDriverLink has an ODBCDriver property, I have no server to test it. The problem is to get this TFDPhysMSSQLDriverLink casting based on FDConnection. Share this post Link to post
Tom Chamberlain 47 Posted Thursday at 01:26 PM Use the TFDConnection object's GetInfoReport() method, it takes a string list. It shows everything you want to know about the connection and the driver it used/picked. We have this on our login/splash screen hidden behind a TLabel double-click event because we were having the same types of issues. Also look into the FDDrivers.ini file configuration. ================================ Connection definition parameters ================================ DriverID=MSSQL Database=******* User_Name=******* Password=***** ODBCAdvanced=TrustServerCertificate=Yes; MARS=Yes Server=192.168.56.109 VariantFormat=String ExtendedMetaData=True ================================ FireDAC info ================================ Tool = RAD Studio 12 FireDAC = 29.0.51961.7529 Platform = Windows 32 bit Defines = FireDAC_NOLOCALE_META;FireDAC_MONITOR ================================ Client info ================================ Loading driver MSSQL ... Loading odbc32.dll driver manager Creating ODBC environment handle Searching for ODBC driver ... Checking for ODBC driver [ODBC DRIVER 18 FOR SQL SERVER] ... Found [ODBC Driver 18 for SQL Server] Driver Manager version = 03.81.19041.0000 ================================ Session info ================================ Checking session ... Warning: The client [18.3.3.0.0] and server [16.0.0.0.0] major versions difference > 1. Warning: MS ODBC 11 does not support SQL_VARIANT data type. Warning: SQL Server 2016 and compatibility level >= 130 may lead to DATETIME comparision failure. Current catalog = Current schema = dbo Driver name = msodbcsql18.dll Driver version = 18.03.0003 Driver conformance = 3 DBMS name = Microsoft SQL Server DBMS version = 16.00.1130 2 Share this post Link to post
weirdo12 19 Posted 9 hours ago Just in case you want a list of the available ODBC drivers, you can do something simple like dropping a TFDPhysODBCDriverLink component on your TDataModule and call TFDPhysODBCDriverLink.GetDrivers, Share this post Link to post