Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post

    Cannot be zero-length error message

    Hello

    I have a form which should insert data into an MS Access 2000 database, but I am getting the following error message:

    Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [Microsoft][ODBC Microsoft Access Driver] Field 'users.fullname' cannot be a zero-length string.

    /myFlash/welcomeFlash.asp, line 20

    However, I have just ensured that all fields allow zero-length values, uploaded the database again and still get the error message. When I look at the database online, I see that all fields are 'nullable'.

    The script above refers to line 20 of my welcomeFlash.asp file which is:

    <% @ Language=VBScript %>

    <%
    ' Declare variables

    Dim fullname,email,subject,country,message

    'Get form field values from flashEmailTest.asp file

    'Open MS Access database, store form field values, and close

    set conn=Server.CreateObject("ADODB.Connection")

    conn.Open "driver={Microsoft Access Driver (*.mdb)};DBQ=D:\Flashform.mdb;"
    set rs = Server.CreateObject("ADODB.recordset")

    SQL="INSERT INTO users (fullname, email, subject,country, message) VALUES ('" & _
    fullname & "', '" & email & "','" & subject & "', '" & country & "', '" & message & "')"

    rs.Open SQL, conn

    Set rs=Nothing

    conn.Close
    Set conn=Nothing
    %>

    The formFlashTest.asp file referred to in the script above (and which gives me the same error message) is simply this:

    <%@LANGUAGE="VBSCRIPT"%>
    <%
    Option Explicit
    Response.Buffer = True
    %>
    <%
    Dim fullname,email,subject,country,message

    fullname = Request.Form("name_txt")
    email = Request.Form("email_txt")
    subject = Request.Form("subject_txt")
    country = Request.Form("country_txt")
    message = Request.Form("message_txt")

    Server.Transfer "welcomeFlash.asp"

    %>

    I would be grateful for any assistance.

    Thanks.

    Steve

  • #2
    Regular Coder
    Join Date
    May 2007
    Location
    UK
    Posts
    180
    Thanks
    0
    Thanked 18 Times in 18 Posts
    A zero-length string is not NULL.

    The field needs the "Allow zero length" attribute to be set to "Yes".


  •  

    Posting Permissions

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