davidwoo
Posts: 53
|
| Posted: 10/10/2007, 7:58 PM |
|
hi all,
When I insert the new row on the editable grid with empty text field, it's shown the error :-
[MySQL][ODBC 3.51 Driver][mysqld-4.1.18-nt-max]Column 'cnotes' cannot be null (Microsoft OLE DB Provider for ODBC Drivers)
the cnotes field I created with "Not Null", if created with "Null" is no problem/error.
I am using MySQL and ASP.
How to solve this?
Thanks.
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 10/11/2007, 9:58 AM |
|
You seem to give the answer to your question yourself?
If a field in MySQL (any SQL) is defined as NOT NULL, it will not accept a NULL value and post an error.
Defined as NULL it will allow for NULL values.
So either change the field in MySQL to NULL (allowed)
OR
make sure there is 'a' value being submitted.
it is not clear from your post what you intend to do.
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
davidwoo
Posts: 53
|
| Posted: 10/11/2007, 6:22 PM |
|
Walter, Thanks for yr reply.
My intention is how can I set the CCS to insert the new field to non-null instead of NULL when the field not entered or emptied to avoid the ODBC error.
Dave.
|
 |
 |
Oper
Posts: 1195
|
| Posted: 10/12/2007, 5:08 AM |
|
Like wk said:
go to your mysql administrator and define the cnote as NULL
unflag the checkmark not null or remove the NOT NULL definition.
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
Wkempees
|
| Posted: 10/12/2007, 5:29 AM |
|
Or:
set default value for cnote to '' (single space).
Very dumb solution but a space is not a NULL.
Your editable grid should check for cnote not empty on addition,
or assign it a default value like 'not entered'
Otherwise, set database column cnote to NULL (allowed)
Walter
|
|
|
 |
|