display null value and others

Results 1 to 2 of 2

Thread: display null value and others

  1. #1
    Join Date
    Dec 1969

    Default display null value and others

    I need to display a db null value I grab from a recordset to a textbox on my web page. The user could edit this or leave it then click a submit button that would validate the textbox value by searching for it in a database table. When it is found there, the value is accepted.<BR><BR>My problem is that I cannot get the db null value to display on the web page. I tried replacing the null value with an empty string ("") to be able to dislay it, but the validation fails because a db null value is not equal to a "".<BR><BR>How should I handle this?<BR>

  2. #2
    Join Date
    Dec 1969

    Default Started right...

    &#060;INPUT Type=Text Name="Whatever" Value="&#060;%= "" & RS("fieldThatMightBeNull") %&#062;" &#062;<BR><BR>See that? Just append the maybe-null field to a "" and you don&#039;t have to replace anything.<BR><BR>And then, when it comes time to look in DB, you&#039;ll want to do<BR><BR>&#060;%<BR>theValue = Request("Whatever")<BR>SQL = "SELECT * FROM table WHERE someField = &#039;" & theValue & "&#039; "<BR>If ( "" & theValue ) = "" Then &#039; if maybe null instead<BR> SQL = SQL & " OR someField IS NULL "<BR>End If<BR>...<BR>%&#062;<BR><BR>In other words, just check the DB field for *either* "" or NULL.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts