|
 |
asp_web_howto thread: Date in Access DB
Message #1 by "John P. Miller" <jpmiller@a...> on Fri, 15 Feb 2002 16:25:59 -0500
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0007_01C1B63D.74092060
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I'm sorry for what is probably a silly question, but I have the
following problem:
I am inserting data into an MS Access DB via my ASP application, it
works very well except when a date field is left blank. If the user
doesn't type a date into the date input box, they get an error that says
data type mismatch. It works if the date is there. How do I fix this?
Thank You,
John Miller
jpmiller@a...
Message #2 by "Drew, Ron" <RDrew@B...> on Fri, 15 Feb 2002 18:21:53 -0500
|
|
This is a multi-part message in MIME format.
------_=_NextPart_001_01C1B677.8D5F54CC
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Two choices
Change the definition of the field to text or
force a date
strdate =3D request.form("fielddate")
if strdate =3D "" then
strdate =3D date
end if
-----Original Message-----
From: John P. Miller [mailto:jpmiller@a...]
Sent: Friday, February 15, 2002 4:26 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Date in Access DB
I'm sorry for what is probably a silly question, but I have the
following problem:
I am inserting data into an MS Access DB via my ASP application, it
works very well except when a date field is left blank. If the user
doesn't type a date into the date input box, they get an error that says
data type mismatch. It works if the date is there. How do I fix this?
Thank You,
John Miller
jpmiller@a...
$subst('Email.Unsub').
Message #3 by "Chris R. Thompson" <cthompson@n...> on Fri, 15 Feb 2002 16:48:14 -0700
|
|
This is a multi-part message in MIME format.
------_=_NextPart_001_01C1B67B.3BF00764
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
You can also set the field to null
If Len(rs("DateField")) < 1 Then
rs("DateField") =3D Null
End if
Chris
-----Original Message-----
From: John P. Miller [mailto:jpmiller@a...]
Sent: Friday, February 15, 2002 2:26 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Date in Access DB
I'm sorry for what is probably a silly question, but I have the
following problem:
I am inserting data into an MS Access DB via my ASP application, it
works very well except when a date field is left blank. If the user
doesn't type a date into the date input box, they get an error that says
data type mismatch. It works if the date is there. How do I fix this?
Thank You,
John Miller
jpmiller@a...
$subst('Email.Unsub').
Message #4 by "Ken Schaefer" <ken@a...> on Mon, 18 Feb 2002 11:41:51 +1100
|
|
Check to see if the user inserted a date. If they didn't, then insert a NULL
into the database:
<%
dteDate = Request.Form("txtDate")
If not isDate(dteDate) then dteDate = Null
%>
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "John P. Miller" <jpmiller@a...>
Subject: [asp_web_howto] Date in Access DB
I'm sorry for what is probably a silly question, but I have the following
problem:
I am inserting data into an MS Access DB via my ASP application, it works
very well except when a date field is left blank. If the user doesn't type a
date into the date input box, they get an error that says data type
mismatch. It works if the date is there. How do I fix this?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #5 by "Steve Holroyd" <spam.free@n...> on Mon, 18 Feb 2002 16:39:09
|
|
Hi,
In the database itself just set the Date field criteria to:
Required = No
Allow Zero length = Yes
Message #6 by "John P. Miller" <jpmiller@a...> on Mon, 18 Feb 2002 12:11:00 -0500
|
|
Allow zero length is not an option.
----- Original Message -----
From: "Steve Holroyd" <spam.free@n...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Monday, February 18, 2002 4:39 PM
Subject: [asp_web_howto] Re: Date in Access DB
> Hi,
> In the database itself just set the Date field criteria to:
> Required = No
> Allow Zero length = Yes
>
$subst('Email.Unsub').
|
|
 |