Populating Null value in SQL Date/Time field 
Author Message
 Populating Null value in SQL Date/Time field

How do you put a Null value into a field that allows it? When I try it I get
"Invalid cast from Enum to DateTime."

My code is below:




Fri, 26 Mar 2004 03:04:35 GMT  
 Populating Null value in SQL Date/Time field

Quote:

> How do you put a Null value into a field that allows it? When I try it I get
> "Invalid cast from Enum to DateTime."


Don't you want dbNull or dbNull.Value?  vbNull is one of the possible
values returned by VB Classic's VarType function, along with vbEmpty,
vbString, vbInteger, etc.

--
Joe Foster <mailto:jlfoster%40znet.com>     On the cans? <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Fri, 26 Mar 2004 08:23:14 GMT  
 Populating Null value in SQL Date/Time field
Thanks Joe!
DBNull.Value worked.




Quote:

> > How do you put a Null value into a field that allows it? When I try it I
get
> > "Invalid cast from Enum to DateTime."


> Don't you want dbNull or dbNull.Value?  vbNull is one of the possible
> values returned by VB Classic's VarType function, along with vbEmpty,
> vbString, vbInteger, etc.

> --
> Joe Foster <mailto:jlfoster%40znet.com>     On the cans?

<http://www.xenu.net/>
Quote:
> WARNING: I cannot be held responsible for the above        They're
coming  to
> because  my cats have  apparently  learned to type.        take me away,
ha ha!



Fri, 26 Mar 2004 10:58:13 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Null date values in Date/Time fields in Access DB

2. Passing a NULL value into a date time field

3. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

4. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

5. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

6. Null values in Date Time Picker

7. Date Time Picker and null value

8. Access date/time null values

9. Access date/time null values

10. NULL VALUES IN DATE FIELD - TYPE MISMATCH ERROR

11. How to give Date fields null values?

12. Allowing a date field to be null value

 

 
Powered by phpBB® Forum Software