Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert or update a Null value to a DateTime field

Status
Not open for further replies.

skyplayer

Programmer
May 28, 2002
13
HK
Is it possible to insert a Null value to a smalldate time field which is allowed Null in VB?
I have tried to assign vbNull and vbEmpty to it, but it prompts "The conversion from datetime data type to smalldatetime data type resulted in a smalldatetime overflow error."
=======================================================
e.g.
rs.open...
rs!testdate = vbNull
rs.update ' -> prompt the error!
=======================================================
So what can I assign to the rs!testdate field in vb by ADO?
 
I tried it, but still fail to assign,
the rs!testdate can't accpet empty string!
 
Can you modify the testdate field so it would accept a Null value?

I guess "testdate" is a time-date data type so it won't accept an empty string. You can try some something like

rs!testdate = ## or rs!testdate = #00-00-00# ...

Sorry, can't help !
 
You might try the following construct:

rs!testdate = CDate(Empty) Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top