Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 19th, 2004, 05:52 PM
Registered User
 
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can Access accept a Null from an ASP web page?

I have an Access database that collects information from a web-based ASP collection form. How do I set a field (with data type is number or date) in my Access in a such a way it will accept a Null or empty string from a web form. I can make "No" on required, but what I have to do with Validation Rule? That is... I want users can still submit the rest of data and leave these fields blank in the collection form.

Note: I can do this with no problems with field of data type as text. Just the date and number data type which I have problems with.
 
Old March 19th, 2004, 09:43 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

If you specify required="no", you don't need to specify anything; just by not inserting anything into those fields will leave it null. Just test to see if the value is provided, and if not, don't do anything. You can specify an empty string for text fields, but null and empty string are two separate things.

I hope I understand the question right. If not, please let me know where I went wrong.
 
Old March 19th, 2004, 11:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
Default

strSQL = "UPDATE myTable SET myField = NULL WHERE RecordID = 1"
objConn.Execute strSQL,,adCmdText+adExecuteNoRecords

Cheers
Ken

Microsoft MVP - Windows Server (IIS)
www.adOpenStatic.com
 
Old March 20th, 2004, 02:12 PM
Authorized User
 
Join Date: Mar 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aliasp Send a message via Yahoo to aliasp
Default

hi kaytrina,

there is a very simply method , just follow :

1- Open you database then select your table.
2- after selected the table,press ( Design).
3- Select the field that you want to be null .
4- if the field is ( Text), select ( All zero length=yes)in the General Gategory.
5- if the field is ( Number), select ( default value =0).

Thanks

         ASP MAN


ali
 
Old March 20th, 2004, 04:38 PM
Registered User
 
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your tips, Ali... But what do I do with fields of data type Date.

Kaytrina

 
Old March 20th, 2004, 07:11 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Kaytrina,

Please take a look at this thread: http://p2p.wrox.com/topic.asp?TOPIC_ID=11015

It explains the difference between null and a zero length string, and digs a little deeper in the implications for your database.
For a date, you can use INSERT INTO MyTable (MyColumn) Values(null) as well.....

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP page not displaying null values imercha Classic ASP Basics 1 January 19th, 2006 02:38 AM
Web Service to accept HTTP-Get jasonfisher .NET Web Services 1 June 9th, 2005 09:31 AM
access webcam from within web page bleitner VBScript 0 August 21st, 2004 09:55 AM
Access to Excell via a web page Sach Classic ASP Basics 1 April 7th, 2004 01:57 PM
How to make integer to accept null value ganesh15 PHP How-To 3 August 18th, 2003 01:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.