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

How do I handle DBNULL? 1

Status
Not open for further replies.

JFrog

IS-IT--Management
Nov 5, 2007
9
US
Basically I have a Access DB...
I try and pull a record from 1 table and Insert into another. When I try and Insert I get a Data Type Mismatch Error. I believe because one field is System.DBNULL. So the Question I have is how do I check the field to see if its a DBNULL then Change the Value to say 0 or something that wont crash my program.
How do I say?
Code:
If Variable = DBNULL Then Varible = 0 End IF
As always I love this forum, you guys are great... and as my experience gets better I hope to return the help to the next person.
 
If IsDBNull(Variable) Then Variable = 0



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top