UPDATING record and zero length strings

Results 1 to 2 of 2

Thread: UPDATING record and zero length strings

  1. #1
    Nick Herbert Guest

    Default UPDATING record and zero length strings

    I want to update an entry in an Access db using an HTML form.<BR><BR>I would like to leave some of the form fields blank, so that when the I update the entry, the field in the database is left blank or the value already entered is retained.<BR><BR>If I insert a new record using an HTML form, I can leave some of the fields blank. This is fine.<BR><BR>However, if I try updating the same record I get error messages saying that zero length strings are not allowed, or that a record is missing from a related table (presumably this is because the form is passing a zero length string to the database, and there is not a zero length string in the related table).<BR><BR>What should I do about this?<BR><BR>Thanks for any suggestions.<BR><BR><BR>Nick<BR><BR>

  2. #2
    David Moran Guest

    Default RE: UPDATING record and zero length strings

    first get the field:<BR><BR>myfield = request.form(myfield)<BR><BR>then check if its null and assign it the string "null" if so<BR><BR>if isnull(myfield) then<BR> myfield = "null"<BR>end<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