We are trying to add the functionality to allow the user to change the SQL server password if it is expired.
The following code snippet using TFDConnection shows what we are trying to do:
FDConnection1.Params.Values['Server'] := 'SQLExpress';
FDConnection1.Params.Values['Database'] := 'TestDatabase';
FDConnection1.Params.Values['User_Name'] := 'testuser';
FDConnection1.Params.Values['Password'] := 'oldpass';
FDConnection1.Params.NewPassword := 'newpass';
But when we get an error while trying to change it: [FireDAC][Phys][ODBC][Microsoft][ODBC SQL Server Driver] Login failed for user 'testuser'. (Error Code is 18456)
Tools we use:
RAD Studio 10.2
FireDAC = 16.0.0 (Build 88974)
Platform = Windows 32 bit
SQL Server 2016 express edition
ODBC Driver 17 for SQL server.
What we observed is that if we use then it works with a patch in FireDAC units. (While debugging we found that it uses a method TFDPhysMSSQLConnection.CheckPasswordChange which uses a connection to check the SQL versions but by that time the connection was not able to make because of the password expiration. So we commented the code inside "CheckPasswordChange" and then it started to work.) But we are told to use ODBC Driver because Microsoft is not going to support Native Client in the future.
Is it possible to change an expired password using FireDAC in combination with ODBC driver.? If that is possible then any advice to fix the problem mentioned above?