Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: I have a form with a text field for a date/time.


Message #1 by "Phil Perks" <philp@w...> on Wed, 23 Aug 2000 11:50:19 +0100
-----Original Message-----



From: Taylor, Brett E (Brett) [mailto:bretttaylor@a...]



Sent: 22 August 2000 22:27



To: 'support@w...'



Subject: Beginning ASP Databases 2726







Hello,



I hope I can make this clear for you



I have a form with a text field for a date/time.



When you click submit with the field blank you get an error



Microsoft OLE DB Provider for ODBC Drivers error '80040e14'



[Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query



expression '##'.



/irs/irsinput1.asp, line 27



this is my insert code



conn.execute "insert into tblDate (dtmReceipt) values (#"&



request.form("dtmReceipt")&"#)"



I am inserting it into an Access DB the field is set for Date/Time.



how can I get it to pass a null value



Thanks



Brett Taylor







Message #2 by Yoram Zehavi <YoramZ@i...> on Wed, 23 Aug 2000 14:08:08 +0200
make sure that the field in the DB alow to get a 'null' value



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

From: Phil Perks [mailto:philp@w...]

Sent: Wednesday, August 23, 2000 12:50 PM

To: ASP Databases

Subject: [asp_databases] I have a form with a text field for a

date/time.





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



From: Taylor, Brett E (Brett) [mailto:bretttaylor@a...]



Sent: 22 August 2000 22:27



To: 'support@w...'



Subject: Beginning ASP Databases 2726







Hello,



I hope I can make this clear for you



I have a form with a text field for a date/time.



When you click submit with the field blank you get an error



Microsoft OLE DB Provider for ODBC Drivers error '80040e14'



[Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query



expression '##'.



/irs/irsinput1.asp, line 27



this is my insert code



conn.execute "insert into tblDate (dtmReceipt) values (#"&



request.form("dtmReceipt")&"#)"



I am inserting it into an Access DB the field is set for Date/Time.



how can I get it to pass a null value



Thanks



Brett Taylor









---

You are currently subscribed to asp_databases 


Message #3 by senthil janarthanam <kjsenthil@u...> on 23 Aug 00 05:16:48 MDT
Hai phil perks

  We can't assign null value to the date field in access or in sqlserver,



But before inserting in to database you can check the value of the form f

or

not null eg

if request.form("dtmreceipt")<>"" then

  conn.execute "insert into tblDate (dtmReceipt) values (#"&



  request.form("dtmReceipt")&"#)"

end if



bye 





senthil.











"Phil Perks" <philp@w...> wrote:

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



From: Taylor, Brett E (Brett) [mailto:bretttaylor@a...]



Sent: 22 August 2000 22:27



To: 'support@w...'



Subject: Beginning ASP Databases 2726







Hello,



I hope I can make this clear for you



I have a form with a text field for a date/time.



When you click submit with the field blank you get an error



Microsoft OLE DB Provider for ODBC Drivers error '80040e14'



[Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query



expression '##'.



/irs/irsinput1.asp, line 27



this is my insert code



conn.execute "insert into tblDate (dtmReceipt) values (#"&



request.form("dtmReceipt")&"#)"



I am inserting it into an Access DB the field is set for Date/Time.



how can I get it to pass a null value



Thanks



Brett Taylor







Message #4 by "Dana Coffey" <dcoffey@x...> on Wed, 23 Aug 2000 07:36:21 -0700
I've always specified for Access.  For instance



If user_input = "" then

	user_input = "ommitted"

End if





I'd be interested to hear how to get Access to take a Null otherwise, as

I've had troubles also.





Dana Coffey

Technologist, Xceed, Inc.

112 Krog St.  Atlanta, GA  30307

tel.  xxx-xxx-xxxx  x 5013

www.xceed.com



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

Everything should be as simple as it is, but not simpler.

----Albert Einstein

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







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

From: Yoram Zehavi 

Sent: Wednesday, August 23, 2000 5:08 AM

To: ASP Databases

Subject: [asp_databases] RE: I have a form with a text field for a

date/ti me.





make sure that the field in the DB alow to get a 'null' value



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

From: Phil Perks [mailto:philp@w...]

Sent: Wednesday, August 23, 2000 12:50 PM

To: ASP Databases

Subject: [asp_databases] I have a form with a text field for a

date/time.





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



From: Taylor, Brett E (Brett) [mailto:bretttaylor@a...]



Sent: 22 August 2000 22:27



To: 'support@w...'



Subject: Beginning ASP Databases 2726







Hello,



I hope I can make this clear for you



I have a form with a text field for a date/time.



When you click submit with the field blank you get an error



Microsoft OLE DB Provider for ODBC Drivers error '80040e14'



[Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query



expression '##'.



/irs/irsinput1.asp, line 27



this is my insert code



conn.execute "insert into tblDate (dtmReceipt) values (#"&



request.form("dtmReceipt")&"#)"



I am inserting it into an Access DB the field is set for Date/Time.



how can I get it to pass a null value



Thanks



Brett Taylor







Message #5 by "David E" <registerukh@h...> on Wed, 23 Aug 2000 09:49:51 PDT
Probably we can assign say 1/1/1900 if the form's date field is blank.





>From: "Dana Coffey" 

>Reply-To: "ASP Databases" <asp_databases@p...>

>To: "ASP Databases" <asp_databases@p...>

>Subject: [asp_databases] RE: I have a form with a text field for a 

>date/ti	me.

>Date: Wed, 23 Aug 2000 07:36:21 -0700

>

>I've always specified for Access.  For instance

>

>If user_input = "" then

>	user_input = "ommitted"

>End if

>

>

>I'd be interested to hear how to get Access to take a Null otherwise, as

>I've had troubles also.

>

>

>Dana Coffey

>Technologist, Xceed, Inc.

>112 Krog St.  Atlanta, GA  30307

>tel.  xxx-xxx-xxxx  x 5013

>www.xceed.com

>

>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

>Everything should be as simple as it is, but not simpler.

>----Albert Einstein

>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

>

>

>

>-----Original Message-----

>From: Yoram Zehavi

>Sent: Wednesday, August 23, 2000 5:08 AM

>To: ASP Databases

>Subject: [asp_databases] RE: I have a form with a text field for a

>date/ti me.

>

>

>make sure that the field in the DB alow to get a 'null' value

>

>-----Original Message-----

>From: Phil Perks [mailto:philp@w...]

>Sent: Wednesday, August 23, 2000 12:50 PM

>To: ASP Databases

>Subject: [asp_databases] I have a form with a text field for a

>date/time.

>

>

>-----Original Message-----

>

>From: Taylor, Brett E (Brett) [mailto:bretttaylor@a...]

>

>Sent: 22 August 2000 22:27

>

>To: 'support@w...'

>

>Subject: Beginning ASP Databases 2726

>

>

>

>Hello,

>

>I hope I can make this clear for you

>

>I have a form with a text field for a date/time.

>

>When you click submit with the field blank you get an error

>

>Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

>

>[Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query

>

>expression '##'.

>

>/irs/irsinput1.asp, line 27

>

>this is my insert code

>

>conn.execute "insert into tblDate (dtmReceipt) values (#"&

>

>request.form("dtmReceipt")&"#)"

>

>I am inserting it into an Access DB the field is set for Date/Time.

>

>how can I get it to pass a null value

>

>Thanks

>

>Brett Taylor

>


  Return to Index