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

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Vladimir Petrov
Posts: 6
Joined: Mon 21 Feb 2005 16:07
Location: Russia, Moscow

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

Post by Vladimir Petrov » Thu 13 Apr 2006 10:18

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

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Fri 14 Apr 2006 08:50

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.

Vladimir Petrov
Posts: 6
Joined: Mon 21 Feb 2005 16:07
Location: Russia, Moscow

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

Post by Vladimir Petrov » Fri 14 Apr 2006 13:07

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 ?

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Fri 14 Apr 2006 14:15

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.

Post Reply