| 网站首页 | 文章中心 | 电子书下载 | 矢量图库 | 视频教程 | 素材下载 | 程序代码下载 | JS代码 | 论坛 | 
常用软件类:
|杀毒安全 |联络聊天 |网络软件 |多媒体类 |系统工具 |图形图像 |系统工具 |应用软件 |行业软件
开发设计类:
|动画制作 |图像处理 |3D设计 |操作系统 |站长学院 |网络相关 |WEB设计 |数据库类 |程序开发
Access数据库中无效的字符字段的行为
作者:佚名    文章来源:网络    点击数:    更新时间:2006-10-24
   Dealing with Null strings in Access database fields


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]
相关文章