VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Deal with NULL in access

by Dee Technologies (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (6 Votes)

By default Access string fields contain NULL values unless a string value (including a blank string like "") has been assigned. When you read these fields using recordsets into VB string variables, you get a runtime type-mismatch error. here is a nice code to get rid of that

Rate Deal with NULL in access

Dim DB As Database
Dim RS As Recordset
Dim sYear As String 
Set DB = OpenDatabase("Biblio.mdb")
Set RS = DB.OpenRecordset("Authors")
sYear = "" & RS![Year Born]
Just add a blank string to the returned field value.

Download this snippet    Add to My Saved Code

Deal with NULL in access Comments

No comments have been posted about Deal with NULL in access. Why not be the first to post a comment about Deal with NULL in access.

Post your comment

Subject:
Message:
0/1000 characters