Page 1 of 1

How to programmaticflly ask user for new password and change user password when account status in Oracle is 'EXPIRED' ?

Posted: Thu 13 Apr 2006 10:18
by Vladimir Petrov
How to programmaticflly ask user for new password and change user password when account status in Oracle is 'EXPIRED' ?

Posted: Fri 14 Apr 2006 08:50
by Challenger
To change user's password that has "expired" status you have to perform following operations:

1. Connect to the server.
2. Call ChangePassword method of TOraSession.
3. Connect to the server using new password.

How I can catch ORA-28001 when call OraSession.Connect ?

Posted: Fri 14 Apr 2006 13:07
by Vladimir Petrov
How I can catch ORA-28001 when call OraSession.Connect ?

When I call OraSession.Connect, username/password dialog displayed
3 times, after that connection failed.

I need after first attemp to connect with ORA-28001 ( password expired ) show my form for enter new password. In this form I can change password and after I must say to connect dialog that connection established and no more attempt needed.

In that place I must install call to my form ?

Posted: Fri 14 Apr 2006 14:15
by Challenger
You can catch ORA-28001 error using OnError event handler of TOraSession. To close ConnectForm after this error is raised you can either set Retries property of TConnectDialog to 1 or make your own descendant of ConnectForm and override DoConnect method.