Advertisement
C_Volume2 Databases/ Data Access/ DAO/ ADO #75830

Deal with NULL in access

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

AI

สรุปโดย AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

ซอร์สโค้ด
original-source
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.
ความคิดเห็นดั้งเดิม (3)
กู้คืนจาก Wayback Machine