Null != NULL in some cases in asp ;)
-
A few days ago, i have to update our prelife server with the new code. The code itself was written in asp (not asp.net) and developed month ago. After updating and running some manual tests, we decided that this code works fine. But we missed something very important... Take a look in this code and think about what happend, after strSQL gets the value Null (database NULL)...
Function SafeSQLString2(byval strSql) if len(strSQL) > 0 then strSql = Replace(strSql, "'", "") end if SafeSQLString2 = strSql end function
The workmate who wrote this code isn't available anymore. At the moment i'm rewriting the complete code and removing all of this trash. -
A few days ago, i have to update our prelife server with the new code. The code itself was written in asp (not asp.net) and developed month ago. After updating and running some manual tests, we decided that this code works fine. But we missed something very important... Take a look in this code and think about what happend, after strSQL gets the value Null (database NULL)...
Function SafeSQLString2(byval strSql) if len(strSQL) > 0 then strSql = Replace(strSql, "'", "") end if SafeSQLString2 = strSql end function
The workmate who wrote this code isn't available anymore. At the moment i'm rewriting the complete code and removing all of this trash.I hope you're using parameterized queries[^] in your new code. There's no need to eliminate quote marks in a field if you use parameters.
DoEvents
: Generating unexpected recursion since 1991 -
I hope you're using parameterized queries[^] in your new code. There's no need to eliminate quote marks in a field if you use parameters.
DoEvents
: Generating unexpected recursion since 1991At the moment i'm banging my head at the wall. I'm thinking about deleting this piece of source and write it from scratch. But thanks for the link. If i ever get the permission to redesign the complete application, the first thing i will do is switching from ASP to something other. At the moment i prefer C#.