想不想get新技能酷炫一下,今天图老师小编就跟大家分享个简单的Access数据库中无效的字符字段的行为教程,一起来看看吧!超容易上手~
【 tulaoshi.com - 编程语言 】
Dealing with Null strings in Access database fields
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)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. The best way to deal with this problem is to use the built-in & operator to concatenate a blank string to each field as you read it. For example:
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]
来源:http://www.tulaoshi.com/n/20160219/1604503.html
看过《Access数据库中无效的字符字段的行为》的人还看了以下文章 更多>>