 |
| 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
|
|
|
|

March 19th, 2004, 05:52 PM
|
|
Registered User
|
|
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

March 19th, 2004, 09:43 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
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.
|
|

March 19th, 2004, 11:14 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
strSQL = "UPDATE myTable SET myField = NULL WHERE RecordID = 1"
objConn.Execute strSQL,,adCmdText+adExecuteNoRecords
Cheers
Ken
Microsoft MVP - Windows Server (IIS)
www.adOpenStatic.com
|
|

March 20th, 2004, 02:12 PM
|
|
Authorized User
|
|
Join Date: Mar 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

March 20th, 2004, 04:38 PM
|
|
Registered User
|
|
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for your tips, Ali... But what do I do with fields of data type Date.
Kaytrina
|
|

March 20th, 2004, 07:11 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|
 |