Jump to content

FireDAC - Change Expired Password

Recommended Posts



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?


Kind Regards,

Soji Mathew.

Edited by Soji
Formatting went wrong after posting the question

Share this post

Link to post
1 hour ago, Dmitry Arefiev said:

This issue was (most probably) fixed in 10.2.2

You mean FireDAC can do with ODBC driver?

Share this post

Link to post

Thanks Dmitry. We will try to update to latest Delphi and see if it works.

Share this post

Link to post

Because of resent problems in getting into CF I cant read my Newly remitted password so it keeps telling me Im wrong, what can I do to change my password, one that I used before this all happened?? Thanks for your help.

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now