In the Delphi 10.2.1 Tokyo version, FireDAC is not compatible with MSSQL2000 by default, prompting "[FIREDAC][PHYS][ODBC][MICROSOFT][ODBC SQL Server Driver][sql Server] Object name ' SYS. DATABASES ' is invalid. "Error, fix for this need to modify the FireDAC.Phys.MSSQL.pas unit:
First copy the FireDAC.Phys.MSSQL.pas file from the Delphi directory, then open it, comment out {$I firedac.inc}, and find the "procedure Tfdphysmssqlconnection.internalsetmeta; ", and then find" scompatlvl: = ' (select Compatibility_level from SYS.) DATABASES WHERE LOWER (NAME) = ' +ansilowercase (scurcatalog) + ') '; ', modify it to:
12345 |
if oconnmeta serverversion >= svMSSQL2008 then scompatlvl: = |
After the above steps, the completion of FIREDAC compatible MSSQL2000 modification.
This is a copy of the Internet, but there are some details to be done.
1. Delete the FireDAC.Phys.MSSQL.dcu file from your Delphi installation directory and record the path of the FIREDAC.PHYS.MSSQL.DCU.
2. At this time, the compiler will be prompted to find the FireDAC.Phys.MSSQL.pas file, copy the file into your program directory, compile and build FIREDAC.PHYS.MSSQL.DCU
3. Copy the generated FIREDAC.PHYS.MSSQL.DCU file to the original directory. So you don't need to put a copy of the FireDAC.Phys.MSSQL.pas file for every project.
Delphi Tokyo Version Firedac connection MSSQL2000 prompt object name ' SYS. DATABASES ' Invalid