Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Null != NULL in some cases in asp ;)

Null != NULL in some cases in asp ;)

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpasp-netdatabasesysadminannouncement
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MrMarco
    wrote on last edited by
    #1

    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.

    M 1 Reply Last reply
    0
    • M MrMarco

      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.

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      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

      M 1 Reply Last reply
      0
      • M Mike Dimmick

        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

        M Offline
        M Offline
        MrMarco
        wrote on last edited by
        #3

        At 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#.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups