OpenWithNewPassword in 11g client has problems with 10g Database
808328Apr 3 2012 — edited Sep 20 2012I have an 11g client and I'm trying to change an expired password in a 10g database but get a ORA-01017 error when I call the OpenWithNewPassword method of a Oracle.DataAccess.Client.OracleConnection object.
You may ask well run with a 10g client, this application needs to serve multiple databases, some 11g some 10g and maybe even some 9i databases hanging around.
Here is my code:
catch (Exception ex)
{
if (ex.Message.StartsWith("ORA-28001:")) // if Expired
{
int stepcount = 0;
try
{
stepcount = 1;
Oracle.DataAccess.Client.OracleConnection oconn = new Oracle.DataAccess.Client.OracleConnection(_connstr);
stepcount = 2;
oconn.OpenWithNewPassword(_newpwd);
stepcount = 3;
oconn.Close(); // just needed to reset the password
stepcount = 4;
}
catch (Exception ex2)
{
_msg = String.Format("Stepcount: {1}.<br>Inner exception Message: {0}", ex2.Message, stepcount);
}
}
else
_msg = String.Format("Non-Expired Message: {0}", ex.Message);
}
I am getting into the Inner exception and my Stepcount = 2. So it is throwing the error here:
oconn.OpenWithNewPassword(_newpwd);
Any ideas?