A String representing the Oracle network specifier used when connecting to a database.
A String representing the user for whom the password is changed.
A String representing the current password for the user.
A String representing the new password for whom the user account is set.
This method is especially useful when a password has expired. In that case, the OpenDatabase or CreateDatabasePool method could return the following error:
ORA-28001 "the password has expired".
Dim OraSession As OraSession
Dim OraDatabase As OraDatabase
Dim password as String
'Note: The DBA could expire scott's password by issuing
'ALTER USER SCOTT PASSWORD EXPIRE
Set OraSession = CreateObject("OracleInProcServer.XOraSession")
password = "tiger"
On Error GoTo err:
Set OraDatabase = OraSession.OpenDatabase("ExampleDb", "scott/" & password, 0&)
'Check for password expiration error
If OraSession.LastServerErr = 28001 Then
OraSession.ChangePassword "ExampleDb", "scott", password, "newpass"
'reset our password variable, then try OpenDatabase again
password = "newpass"