|
 |
asp_databases thread: ASP Database error
Message #1 by "Joe" <jwboy78@h...> on Mon, 28 Aug 2000 17:58:0
|
|
I have a form that people are filling out. If they leave a field blank I
get an error that say:
Microsoft Jet database engine error '80004005'
Field 'contact.chkMail" cannot be zere-length string
line 70. But line 70 is
<b>adoconn.execute(ssql)..
Please help.
Message #2 by "Curtis F. Barnett" <cfb@s...> on Mon, 28 Aug 2000 13:54:33 -0500
|
|
Check your Field Properties... Allow 0 length and required
CFB
> -----Original Message-----
> From: Joe [mailto:jwboy78@h...]
> Sent: Monday, August 28, 2000 12:00 PM
> To: ASP Databases
> Subject: [asp_databases] ASP Database error
>
>
> I have a form that people are filling out. If they leave a field blank I
> get an error that say:
>
> Microsoft Jet database engine error '80004005'
> Field 'contact.chkMail" cannot be zere-length string
>
> line 70. But line 70 is
>
> <b>adoconn.execute(ssql)..
>
>
> Please help.
>
> ---
> You are currently subscribed to asp_databases
> $subst('Email.Unsub')
>
>
>
Message #3 by JonGrman21@a... on Mon, 28 Aug 2000 15:03:11 EDT
|
|
thats not the line causing the error its probably the line before it and go
into the database and choose the field thats giving you that error and change
its property so that it accepts zero length strings
Message #4 by "Ken Schaefer" <ken@a...> on Tue, 29 Aug 2000 11:24:42 +1000
|
|
In your database you have set the field so that it can't contain a zero
length field, yet you are trying to update the database and set the field to
a zero length.
The error is thrown when you try to execute the SQL statement (ie send the
SQL statement to the database).
Rethink your design:
a) If the fields are required then make the users fill them in
b) If the fields are required or unknown, then substitute NULLs for empty
fields
c) If the fields are not required, change the design of your database to
allow zero length fields for the fields in question.
Cheers
Ken
----- Original Message -----
From: "Joe" <jwboy78@h...>
To: "ASP Databases" <asp_databases@p...>
Sent: Monday, August 28, 2000 5:00 PM
Subject: [asp_databases] ASP Database error
> I have a form that people are filling out. If they leave a field blank I
> get an error that say:
>
> Microsoft Jet database engine error '80004005'
> Field 'contact.chkMail" cannot be zere-length string
>
> line 70. But line 70 is
>
> <b>adoconn.execute(ssql)..
>
>
> Please help.
>
> ---
> You are currently subscribed to asp_databases
$subst('Email.Unsub')
>
Message #5 by Dan Te Whaiti <dant@h...> on Tue, 29 Aug 2000 09:02:45 +1200
|
|
YOU NEED TO REDESIGN YOUR ACCESS TABLE/FIELD TO ALLOW NULL VALUES TO BE
ENTERED.
REGARDS DAN
-----Original Message-----
From: Joe [mailto:jwboy78@h...]
Sent: Monday, August 28, 2000 1:00 PM
To: ASP Databases
Subject: [asp_databases] ASP Database error
I have a form that people are filling out. If they leave a field blank I
get an error that say:
Microsoft Jet database engine error '80004005'
Field 'contact.chkMail" cannot be zere-length string
line 70. But line 70 is
<b>adoconn.execute(ssql)..
Please help.
---
You are currently subscribed to asp_databases
*****************************************************************
Hawke's Bay Network Limited uses e-mail as a fast and relatively
informal means of communication. If in doubt as to the official
status of a message, or if you want formal confirmation, please
ask the sender. We are not responsible for any changes made to a
message and/or any attachments after sending.
*****************************************************************
Message #6 by Imar Spaanjaars <Imar@S...> on Mon, 28 Aug 2000 21:11:57 +0200
|
|
That is because in that line, the SQL statement is executed (the record is
inserted or updated).
If your SQL string is lacking the right information or contains an error,
the update / insert statement will fail.
Do a response.write(ssql) just before you do the insert (that is before
line 70). Then you can see what the problem is.
If it is because somebody forgets to fill in a field, either make it a
required field by adding some JavaScript on the client and check the fields
again on the server (older browsers allow you to submit form-data without
the JavaScript checking-routines being fired), or make the field not
required in the database, and don't add the name of the field to your SQL
statement.
Imar
At 05:58 PM 8/28/2000 +0000, you wrote:
>I have a form that people are filling out. If they leave a field blank I
>get an error that say:
>
>Microsoft Jet database engine error '80004005'
>Field 'contact.chkMail" cannot be zere-length string
>
>line 70. But line 70 is
>
><b>adoconn.execute(ssql)..
>
>
>Please help.
>
>---
>You are currently subscribed to asp_databases
Message #7 by Gregory_Griffiths@c... on Tue, 29 Aug 2000 08:34:13 +0100
|
|
what you need to do is :
1. Check the content of the form in Javascript on the client side.
2. Check the content of the form on the server side using your ASP.
3. Build the SQL in a modular manner.
You can replace any failed values with defaults at step 1 or 2 or just
leave it out in step 3.
e.g.
SQLStatement="Select * from contact Where username=".username
if (chkMail).length>0 then
SQLStatement=SQLStatement." AND contact.chkMail=".chkmail
end if
> -----Original Message-----
> From: jwboy
> Sent: 28 August 2000 17:58
> To: asp_databases@p...
> Subject: FW: [asp_databases] ASP Database error
>
>
> I have a form that people are filling out. If they leave a
> field blank I
> get an error that say:
>
> Microsoft Jet database engine error '80004005'
> Field 'contact.chkMail" cannot be zere-length string
>
> line 70. But line 70 is
>
> <b>adoconn.execute(ssql)..
>
>
> Please help.
>
|
|
 |