This topic is locked

Allows Nulls as Input?

7/4/2006 12:10:29 PM
ASPRunnerPro General questions
N
nealwalters author

Is it possible to allow nulls as input? In other words, if I do not enter a value for a string or a number, I want it to store a NULL value in the database.
If I leave a field blank, I get this error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
/students/ASPRunnerCoupons/coupon_add.asp, line 613
Can't you at least check for blank-field and not give such an ugly error?
Thanks,

Neal

R
Rhoffman 7/4/2006

Neal-
That error occurs when you are attempting to enter too much data into a field. I.e. putting 20 characters into a field set to hold 10 characters. It has nothing to do with NULL values.

Sergey Kornilov admin 7/5/2006

Neal,
how does ASP page know if you like to store NULL value or empty string?

It's impossible to tell what exactly needs to be placed in text field.
This ugly error message is produced by the database itself and usually means entered value is inconsistent with field type.