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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database management

Status
Not open for further replies.

jjhobs

Instructor
Sep 18, 2003
27
GB
I am trying to create a front end to an Access database with VB .Net. The problem I have is with number and date fields. If I create a new record in VB. Net and try to add it to the database it accepts null values with no problem using DBNull. However, if I try to edit a record and enter a blank into a number or date field which previously contained a value DBNull does not work. The previous value keeps reappearing. Could somebody tell me how to get round this problem. Thanks.
 
You're trying to enter DBNull or you're trying to enter blank?

A blank space is not the same as NULL and is invalid in a date field or a numeric field.

Access (i.e. JET) is probably raising an error along the lines of "Type Mismatch" but you are not trapping the error.
 
Thank you. What I want is to empty the field, ie, not data at all in it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top