I just inherited a legacy asp app that the client wants to make more secure. I'm having issues changing all the dynamic queries to parameterized queries. The app uses an oracle backend.
So far...
***********
Dim strSql, dcConnection, rsApplications, objCommand,
strSql = "SELECT DISTINCT [field1] FROM [table1] WHERE [field1] = :ID"
Set dcConnection = GetConnection()
Set rsApplications = Server.CreateObject("ADODB.Recordset")
Set objCommand = Server.CreateObject("ADODB.Command")
objCommand.ActiveConnection = dcConnection
objCommand.CommandText = strSql
objCommand.Parameters.Append (objCommand.CreateParameter(":ID", adVarChar, adParamInput, 4, "ABCD"))
Set rsApplications = objCommand.Execute()
***********
When I include the value "ABCD" in the WHERE clause it works as expected within a second. When I use the code above the query times out.
While grasping at straws I tried to swap out the : with @ and ? to no avail.
Any support would be appreciated.
So far...
***********
Dim strSql, dcConnection, rsApplications, objCommand,
strSql = "SELECT DISTINCT [field1] FROM [table1] WHERE [field1] = :ID"
Set dcConnection = GetConnection()
Set rsApplications = Server.CreateObject("ADODB.Recordset")
Set objCommand = Server.CreateObject("ADODB.Command")
objCommand.ActiveConnection = dcConnection
objCommand.CommandText = strSql
objCommand.Parameters.Append (objCommand.CreateParameter(":ID", adVarChar, adParamInput, 4, "ABCD"))
Set rsApplications = objCommand.Execute()
***********
When I include the value "ABCD" in the WHERE clause it works as expected within a second. When I use the code above the query times out.
While grasping at straws I tried to swap out the : with @ and ? to no avail.
Any support would be appreciated.