Date - acces db - allow zero length???

Results 1 to 4 of 4

Thread: Date - acces db - allow zero length???

  1. #1
    Isabelle Guest

    Default Date - acces db - allow zero length???

    Hi,<BR><BR>How can I allow a zero-length date-field in an access database?<BR><BR>if request.form("datum") is null or<BR>if request.form("datum") = "" doesn&#039t work <BR><BR>Thanks

  2. #2
    Joseph Hatcher Guest

    Default RE: Date - acces db - allow zero length???

    Try<BR><BR>I assume you are using VBscript<BR>if (IsNull(request.form("datum")) then<BR>.......<BR><BR>If you are using Javascript try<BR>if (request.form("datum")==""){}<BR><BR>Hope this helps<BR><BR>Joseph Hatcher<BR>

  3. #3
    Isabelle Guest

    Default RE: Date - acces db - allow zero length??? - still...

    OK, this works, but I still can&#039t insert a zero-length date-field in my ACCESS DB, <BR> even when I set explicitely datum = null, it &#039s automatically converted into a zero-string ("") and this gives an error.<BR>When I execute the query in ACCESS, it works with the null-value, but not with the zero-string("")<BR>How can Isolve this???

  4. #4
    Joseph Hatcher Guest

    Default RE: Date - acces db - allow zero length??? - still...

    I am not sure I fully understand your question.<BR>Let me throw a few things at you and see if this works<BR><BR>First off, you can change the settings in Access to make the date field required or not required. Instead of entering blank strings change this to not required.<BR><BR>Now in you code write (vbscript used)<BR><BR>if (not (IsNull(datum))) then<BR>if (IsDate(datum)) then<BR>sqlstmt = "insert into ........"<BR>else<BR>&#039error not a valid date<BR>end if<BR>end if<BR><BR><BR>I cant figure out rather your error is in the Access Database design or in your coding logic?<BR><BR>Hope this helps<BR><BR>Joseph Hatcher


Posting Permissions

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