Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-21-2007, 02:56 PM   PM User | #1
SteveH
Regular Coder

 
Join Date: Nov 2005
Posts: 615
Thanks: 91
Thanked 1 Time in 1 Post
SteveH is an unknown quantity at this point
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
SteveH is offline   Reply With Quote
Old 12-23-2007, 01:59 PM   PM User | #2
SouthwaterDave
Regular Coder

 
Join Date: May 2007
Location: UK
Posts: 180
Thanks: 0
Thanked 18 Times in 18 Posts
SouthwaterDave is on a distinguished road
A zero-length string is not NULL.

The field needs the "Allow zero length" attribute to be set to "Yes".
SouthwaterDave is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:02 PM.


Advertisement
Log in to turn off these ads.