Archive for category ASP

Resetting an Oracle password through .NET

In case you ever want to reset an Oracle password through ASP.NET, without worrying about pesky things like SQL injection attacks or any other security holes (what could possibly go wrong…)

public void ResetPassword (string pUserName, string pPassWord, string connString) {
       string query = "alter user " + pUserName + " identified by " + pPassWord;
       using (OracleConnection conn = new OracleConnection(connString)) {
           using (OracleCommand comm = new OracleCommand(query, conn)) {
              conn.Open();
              comm.ExecuteNonQuery();
           }
       }
}
Advertisements

1 Comment

Calling the VBScript InStr function returns error

I am forced to work in classic ASP for some project. I don’t want to, it’s not my idea, but there we have it – the life of a consultant is fraught with peril.

While working on some VBScript code, I wrote some code to check permissions using the InStr function, and ran into this error:

Invalid procedure call or argument: 'InStr'

My call to InStr looked like this:

InStr(0, AllowablePermissions,UserPermissions)

According to w3schools.com , the first parameter, which was optional, defined the starting location. On a whim, I removed the first parameter, so my function call then looked liked this:

InStr(AllowablePermissions,UserPermissions)

And it worked. Go figure.

1 Comment