Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Urgent! Help! Error inserting record into Access 97 database


Message #1 by "Miss G A Ruberto" <rubertoga@u...> on Thu, 14 Feb 2002 12:41:35
V.V. new to ASP, little help at college nobody else is doing ASP, project 

due Friday 22 February 2002.  I think something is wrong with my string 

Please help.



The following code generates the following error:



Microsoft OLE DB Provider for ODBC Drivers error '80004005' 



[Microsoft][ODBC Microsoft Access Driver] Field 'Customer.Name' cannot be 

a zero-length string. 



/origin/reg1.asp, line 30 



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>

<HEAD>

<TITLE>Origin, Registration Confirmation</TITLE>

<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</HEAD>

<BODY BGCOLOR ="FFFFFD"

LINK="#006363"

VLINK="#087B7B"

ALINK="#083194">

<% @LANGUAGE = VBScript %>

<%strname = request.form("Name")%>

<%straddress = request.form("Address")%>

<%straddress2 = request.form("Address2")%>

<%strtown = request.form("Town")%>

<%strpostcode = request.form("Postcode")%>

<%strtel = request.form("TelNo")%>

<%strfax = request.form("FaxNo")%>

<%stremail = request.form("Email")%>

<%

Set conn1 = Server.CreateObject("ADODB.Connection")

conn1.Open "PROVIDER=MSDASQL;" & _

"DRIVER={Microsoft Access Driver (*.mdb)}; " & _

"DBQ=" & server.mappath("origin.mdb")

 %>



<%

sqlstring="INSERT INTO Customer (Name, Address, Address2, Town, Postcode, 

Telephone, Fax,Email) values ('" & strname & "','" & straddress & "','" & 

straddress2 & "','" & strtown & "','" & strpostcode & "','" & strtel 

& "','" & strfax & "', '" & stremail & "')"



Set rs=conn1.Execute(sqlstring)

%>

<IMG SRC = "images/regconf.gif" ALT = "Registration Confirmation Logo" 

WIDTH="738" HEIGHT="64">

<BR>

<TABLE WIDTH = "700">

<TR>

<TD VALIGN=top ALIGN=center WIDTH="30%">

<BR>

<BR>

<A HREF="main.html"><IMG SRC="images/home.gif" ALT="Origin Home" 

WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

<A HREF="info.html"><IMG SRC="images/info.gif" ALT="Origin Information" 

WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

<A HREF="products.html"><IMG SRC="images/products.gif" ALT="Products" 

WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

<A HREF="order.html"><IMG SRC="images/order.gif" ALT="Order Online" 

WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

<A HREF="register.html"><IMG SRC="images/reg.gif" ALT="Trade Customer 

Registration" WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

<A HREF ="contact.html"><IMG SRC="images/contact.gif" ALT="Contact Us" 

WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

</TD>

<TD WIDTH = "70%">

<FONT FACE = "Verdana" SIZE="2">

<BR>

<BR>

Your details have successfully been registered with our database, If any 

of your details change please <A HREF = "contact.html">contact us</A> so 

we can update our records.<BR>

<BR>

We will be sending you a welcome letter and catalogue in due course, 

however if you would like to <A HREF = "order.html">order online</A> 

straight away you will need to retrieve your account number from our 

records.  To do this simply input your name and postcode below and click

 "Submit".  Your account number will be displayed, please make a note of 

it as you will need it to order online.  Origin would like to reassure 

customers

that their account details are secure and that no order can be placed 

without speaking to the account holder directly (further information will 

be requested

 by one of our sales representatives at the time an order is confirmed).

<BR>

</FONT>

</TD>

</TR>

</TABLE>

<CENTER>

<FONT FACE = "Verdana" SIZE = "2">

<BR>

<BR>

<A HREF="main.html">[ Home ]</A>

<A HREF="info.html">[ Origin Info. ]</A>

<A HREF = "order.html">[ Order Online ]</A>

<A HREF="products.html">[ Products ]</A>

<A HREF="register.html">[ Trade Customer Registration ]</A>

<A HREF="contact.html">[ Contact Us ]</A>

</FONT>

</CENTER>

</BODY>

</HTML>
Message #2 by "Ian Richardson" <ian@i...> on Thu, 14 Feb 2002 12:36:46 -0000
You need to set 'Allow Zero Length String' to yes in the Design View .

ian

----- Original Message -----

From: "Miss G A Ruberto" <rubertoga@u...>

To: "Access ASP" <access_asp@p...>

Sent: Thursday, February 14, 2002 12:41 PM

Subject: [access_asp] Urgent! Help! Error inserting record into Access 97

database





> V.V. new to ASP, little help at college nobody else is doing ASP, project

> due Friday 22 February 2002.  I think something is wrong with my string

> Please help.

>

> The following code generates the following error:

>

> Microsoft OLE DB Provider for ODBC Drivers error '80004005'

>

> [Microsoft][ODBC Microsoft Access Driver] Field 'Customer.Name' cannot be

> a zero-length string.

>

> /origin/reg1.asp, line 30

>

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

> <HTML>

> <HEAD>

> <TITLE>Origin, Registration Confirmation</TITLE>

> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

> </HEAD>

> <BODY BGCOLOR ="FFFFFD"

> LINK="#006363"

> VLINK="#087B7B"

> ALINK="#083194">

> <% @LANGUAGE = VBScript %>

> <%strname = request.form("Name")%>

> <%straddress = request.form("Address")%>

> <%straddress2 = request.form("Address2")%>

> <%strtown = request.form("Town")%>

> <%strpostcode = request.form("Postcode")%>

> <%strtel = request.form("TelNo")%>

> <%strfax = request.form("FaxNo")%>

> <%stremail = request.form("Email")%>

> <%

> Set conn1 = Server.CreateObject("ADODB.Connection")

> conn1.Open "PROVIDER=MSDASQL;" & _

> "DRIVER={Microsoft Access Driver (*.mdb)}; " & _

> "DBQ=" & server.mappath("origin.mdb")

>  %>

>

> <%

> sqlstring="INSERT INTO Customer (Name, Address, Address2, Town, Postcode,

> Telephone, Fax,Email) values ('" & strname & "','" & straddress & "','" &

> straddress2 & "','" & strtown & "','" & strpostcode & "','" & strtel

> & "','" & strfax & "', '" & stremail & "')"

>

> Set rs=conn1.Execute(sqlstring)

> %>

> <IMG SRC = "images/regconf.gif" ALT = "Registration Confirmation Logo"

> WIDTH="738" HEIGHT="64">

> <BR>

> <TABLE WIDTH = "700">

> <TR>

> <TD VALIGN=top ALIGN=center WIDTH="30%">

> <BR>

> <BR>

> <A HREF="main.html"><IMG SRC="images/home.gif" ALT="Origin Home"

> WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

> <A HREF="info.html"><IMG SRC="images/info.gif" ALT="Origin Information"

> WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

> <A HREF="products.html"><IMG SRC="images/products.gif" ALT="Products"

> WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

> <A HREF="order.html"><IMG SRC="images/order.gif" ALT="Order Online"

> WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

> <A HREF="register.html"><IMG SRC="images/reg.gif" ALT="Trade Customer

> Registration" WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

> <A HREF ="contact.html"><IMG SRC="images/contact.gif" ALT="Contact Us"

> WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

> </TD>

> <TD WIDTH = "70%">

> <FONT FACE = "Verdana" SIZE="2">

> <BR>

> <BR>

> Your details have successfully been registered with our database, If any

> of your details change please <A HREF = "contact.html">contact us</A> so

> we can update our records.<BR>

> <BR>

> We will be sending you a welcome letter and catalogue in due course,

> however if you would like to <A HREF = "order.html">order online</A>

> straight away you will need to retrieve your account number from our

> records.  To do this simply input your name and postcode below and click

>  "Submit".  Your account number will be displayed, please make a note of

> it as you will need it to order online.  Origin would like to reassure

> customers

> that their account details are secure and that no order can be placed

> without speaking to the account holder directly (further information will

> be requested

>  by one of our sales representatives at the time an order is confirmed).

> <BR>

> </FONT>

> </TD>

> </TR>

> </TABLE>

> <CENTER>

> <FONT FACE = "Verdana" SIZE = "2">

> <BR>

> <BR>

> <A HREF="main.html">[ Home ]</A>

> <A HREF="info.html">[ Origin Info. ]</A>

> <A HREF = "order.html">[ Order Online ]</A>

> <A HREF="products.html">[ Products ]</A>

> <A HREF="register.html">[ Trade Customer Registration ]</A>

> <A HREF="contact.html">[ Contact Us ]</A>

> </FONT>

> </CENTER>

> </BODY>

> </HTML>




$subst('Email.Unsub').



Message #3 by Bob Maarschalkerweerd <BobM@h...> on Thu, 14 Feb 2002 09:24:30 -0500
Hi there,



I have come across this error many times.. Open the Access database in

question and go to the Design option for that table. Check all the fields

under the General Tab where "Allow Zero Length" is YES, change that to NO.

Let me know if that works .. You may also need to examine the Required field

also.



Regards,

Bob Maarschalkerweerd

-------------------------------------

Ph  (xxx) xxx-xxxx

Fax  (xxx) xxx-xxxx

Cell  (xxx) xxx-xxxx

mailto:bobm@h...





-----Original Message-----

From: Miss G A Ruberto [mailto:rubertoga@u...]

Sent: Thursday, February 14, 2002 7:42 AM

To: Access ASP

Subject: [access_asp] Urgent! Help! Error inserting record into Access

97 database





V.V. new to ASP, little help at college nobody else is doing ASP, project 

due Friday 22 February 2002.  I think something is wrong with my string 

Please help.



The following code generates the following error:



Microsoft OLE DB Provider for ODBC Drivers error '80004005' 



[Microsoft][ODBC Microsoft Access Driver] Field 'Customer.Name' cannot be 

a zero-length string. 



/origin/reg1.asp, line 30 



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>

<HEAD>

<TITLE>Origin, Registration Confirmation</TITLE>

<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</HEAD>

<BODY BGCOLOR ="FFFFFD"

LINK="#006363"

VLINK="#087B7B"

ALINK="#083194">

<% @LANGUAGE = VBScript %>

<%strname = request.form("Name")%>

<%straddress = request.form("Address")%>

<%straddress2 = request.form("Address2")%>

<%strtown = request.form("Town")%>

<%strpostcode = request.form("Postcode")%>

<%strtel = request.form("TelNo")%>

<%strfax = request.form("FaxNo")%>

<%stremail = request.form("Email")%>

<%

Set conn1 = Server.CreateObject("ADODB.Connection")

conn1.Open "PROVIDER=MSDASQL;" & _

"DRIVER={Microsoft Access Driver (*.mdb)}; " & _

"DBQ=" & server.mappath("origin.mdb")

 %>



<%

sqlstring="INSERT INTO Customer (Name, Address, Address2, Town, Postcode, 

Telephone, Fax,Email) values ('" & strname & "','" & straddress & "','" & 

straddress2 & "','" & strtown & "','" & strpostcode & "','" & strtel 

& "','" & strfax & "', '" & stremail & "')"



Set rs=conn1.Execute(sqlstring)

%>

<IMG SRC = "images/regconf.gif" ALT = "Registration Confirmation Logo" 

WIDTH="738" HEIGHT="64">

<BR>

<TABLE WIDTH = "700">

<TR>

<TD VALIGN=top ALIGN=center WIDTH="30%">

<BR>

<BR>

<A HREF="main.html"><IMG SRC="images/home.gif" ALT="Origin Home" 

WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

<A HREF="info.html"><IMG SRC="images/info.gif" ALT="Origin Information" 

WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

<A HREF="products.html"><IMG SRC="images/products.gif" ALT="Products" 

WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

<A HREF="order.html"><IMG SRC="images/order.gif" ALT="Order Online" 

WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

<A HREF="register.html"><IMG SRC="images/reg.gif" ALT="Trade Customer 

Registration" WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

<A HREF ="contact.html"><IMG SRC="images/contact.gif" ALT="Contact Us" 

WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

</TD>

<TD WIDTH = "70%">

<FONT FACE = "Verdana" SIZE="2">

<BR>

<BR>

Your details have successfully been registered with our database, If any 

of your details change please <A HREF = "contact.html">contact us</A> so 

we can update our records.<BR>

<BR>

We will be sending you a welcome letter and catalogue in due course, 

however if you would like to <A HREF = "order.html">order online</A> 

straight away you will need to retrieve your account number from our 

records.  To do this simply input your name and postcode below and click

 "Submit".  Your account number will be displayed, please make a note of 

it as you will need it to order online.  Origin would like to reassure 

customers

that their account details are secure and that no order can be placed 

without speaking to the account holder directly (further information will 

be requested

 by one of our sales representatives at the time an order is confirmed).

<BR>

</FONT>

</TD>

</TR>

</TABLE>

<CENTER>

<FONT FACE = "Verdana" SIZE = "2">

<BR>

<BR>

<A HREF="main.html">[ Home ]</A>

<A HREF="info.html">[ Origin Info. ]</A>

<A HREF = "order.html">[ Order Online ]</A>

<A HREF="products.html">[ Products ]</A>

<A HREF="register.html">[ Trade Customer Registration ]</A>

<A HREF="contact.html">[ Contact Us ]</A>

</FONT>

</CENTER>

</BODY>

</HTML>




Message #4 by Bob Maarschalkerweerd <BobM@h...> on Thu, 14 Feb 2002 09:26:47 -0500
OOPS! Got that the wrong way around. Ensure the "Allow Zero Length" is NO 



Regards,

Bob Maarschalkerweerd

-------------------------------------

Ph  (xxx) xxx-xxxx

Fax  (xxx) xxx-xxxx

Cell  (xxx) xxx-xxxx

mailto:bobm@h...





-----Original Message-----

From: Bob Maarschalkerweerd [mailto:BobM@h...]

Sent: Thursday, February 14, 2002 9:25 AM

To: Access ASP

Subject: [access_asp] RE: Urgent! Help! Error inserting record into

Access 97 database





Hi there,



I have come across this error many times.. Open the Access database in

question and go to the Design option for that table. Check all the fields

under the General Tab where "Allow Zero Length" is YES, change that to NO.

Let me know if that works .. You may also need to examine the Required field

also.



Regards,

Bob Maarschalkerweerd

-------------------------------------

Ph  (xxx) xxx-xxxx

Fax  (xxx) xxx-xxxx

Cell  (xxx) xxx-xxxx

mailto:bobm@h...





-----Original Message-----

From: Miss G A Ruberto [mailto:rubertoga@u...]

Sent: Thursday, February 14, 2002 7:42 AM

To: Access ASP

Subject: [access_asp] Urgent! Help! Error inserting record into Access

97 database





V.V. new to ASP, little help at college nobody else is doing ASP, project 

due Friday 22 February 2002.  I think something is wrong with my string 

Please help.



The following code generates the following error:



Microsoft OLE DB Provider for ODBC Drivers error '80004005' 



[Microsoft][ODBC Microsoft Access Driver] Field 'Customer.Name' cannot be 

a zero-length string. 



/origin/reg1.asp, line 30 



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>

<HEAD>

<TITLE>Origin, Registration Confirmation</TITLE>

<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</HEAD>

<BODY BGCOLOR ="FFFFFD"

LINK="#006363"

VLINK="#087B7B"

ALINK="#083194">

<% @LANGUAGE = VBScript %>

<%strname = request.form("Name")%>

<%straddress = request.form("Address")%>

<%straddress2 = request.form("Address2")%>

<%strtown = request.form("Town")%>

<%strpostcode = request.form("Postcode")%>

<%strtel = request.form("TelNo")%>

<%strfax = request.form("FaxNo")%>

<%stremail = request.form("Email")%>

<%

Set conn1 = Server.CreateObject("ADODB.Connection")

conn1.Open "PROVIDER=MSDASQL;" & _

"DRIVER={Microsoft Access Driver (*.mdb)}; " & _

"DBQ=" & server.mappath("origin.mdb")

 %>



<%

sqlstring="INSERT INTO Customer (Name, Address, Address2, Town, Postcode, 

Telephone, Fax,Email) values ('" & strname & "','" & straddress & "','" & 

straddress2 & "','" & strtown & "','" & strpostcode & "','" & strtel 

& "','" & strfax & "', '" & stremail & "')"



Set rs=conn1.Execute(sqlstring)

%>

<IMG SRC = "images/regconf.gif" ALT = "Registration Confirmation Logo" 

WIDTH="738" HEIGHT="64">

<BR>

<TABLE WIDTH = "700">

<TR>

<TD VALIGN=top ALIGN=center WIDTH="30%">

<BR>

<BR>

<A HREF="main.html"><IMG SRC="images/home.gif" ALT="Origin Home" 

WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

<A HREF="info.html"><IMG SRC="images/info.gif" ALT="Origin Information" 

WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

<A HREF="products.html"><IMG SRC="images/products.gif" ALT="Products" 

WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

<A HREF="order.html"><IMG SRC="images/order.gif" ALT="Order Online" 

WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

<A HREF="register.html"><IMG SRC="images/reg.gif" ALT="Trade Customer 

Registration" WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

<A HREF ="contact.html"><IMG SRC="images/contact.gif" ALT="Contact Us" 

WIDTH="160" HEIGHT="24" ALIGN=top BORDER="0"></A>

</TD>

<TD WIDTH = "70%">

<FONT FACE = "Verdana" SIZE="2">

<BR>

<BR>

Your details have successfully been registered with our database, If any 

of your details change please <A HREF = "contact.html">contact us</A> so 

we can update our records.<BR>

<BR>

We will be sending you a welcome letter and catalogue in due course, 

however if you would like to <A HREF = "order.html">order online</A> 

straight away you will need to retrieve your account number from our 

records.  To do this simply input your name and postcode below and click

 "Submit".  Your account number will be displayed, please make a note of 

it as you will need it to order online.  Origin would like to reassure 

customers

that their account details are secure and that no order can be placed 

without speaking to the account holder directly (further information will 

be requested

 by one of our sales representatives at the time an order is confirmed).

<BR>

</FONT>

</TD>

</TR>

</TABLE>

<CENTER>

<FONT FACE = "Verdana" SIZE = "2">

<BR>

<BR>

<A HREF="main.html">[ Home ]</A>

<A HREF="info.html">[ Origin Info. ]</A>

<A HREF = "order.html">[ Order Online ]</A>

<A HREF="products.html">[ Products ]</A>

<A HREF="register.html">[ Trade Customer Registration ]</A>

<A HREF="contact.html">[ Contact Us ]</A>

</FONT>

</CENTER>

</BODY>

</HTML>









Message #5 by "Ken Schaefer" <ken@a...> on Fri, 15 Feb 2002 11:48:47 +1100
You need to look at the specifications for your project.



If the project requires NULL values where there is no supplied value then

you have to insert a NULL:



INSERT INTO

    Table1

    (

        field1

    )

VALUES

    (

        NULL

    )



Otherwise, if you allow zero length strings, change the property in Access.



Lastly, if you require a value, insert a default value, or force the user to

enter one.



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Miss G A Ruberto" <rubertoga@u...>

Subject: [access_asp] Urgent! Help! Error inserting record into Access 97

database





: V.V. new to ASP, little help at college nobody else is doing ASP, project

: due Friday 22 February 2002.  I think something is wrong with my string

: Please help.

:

: The following code generates the following error:

:

: Microsoft OLE DB Provider for ODBC Drivers error '80004005'

:

: [Microsoft][ODBC Microsoft Access Driver] Field 'Customer.Name' cannot be

: a zero-length string.

:

: /origin/reg1.asp, line 30



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




  Return to Index