表 abc
编号 姓名 爱好
001 田亮 跳水
002 周星星
除了编号,姓名和爱好不是要必填
在form表单增加一个text控件 txtInterest
sql="select * from abc"
rst.open sql
txtInterest.Text=rst("爱好")
当curor移到002纪录出错
runtime error '94';
invalid use of Null
/////////////////////////
如是这样处理
If rst("爱好").Value = Empty Then
MsgBox "empty"
ElseIf rst("爱好").Value = Null Then
MsgBox "null"
ElseIf rst("爱好").Value = "" Then
MsgBox "/"
Else
MsgBox rst("爱好").Value
End If结果还是
runtime error '94';
invalid use of Null
并且错误行是 MsgBox rst("爱好").Value
到底怎么回事,望高手指正
编号 姓名 爱好
001 田亮 跳水
002 周星星
除了编号,姓名和爱好不是要必填
在form表单增加一个text控件 txtInterest
sql="select * from abc"
rst.open sql
txtInterest.Text=rst("爱好")
当curor移到002纪录出错
runtime error '94';
invalid use of Null
/////////////////////////
如是这样处理
If rst("爱好").Value = Empty Then
MsgBox "empty"
ElseIf rst("爱好").Value = Null Then
MsgBox "null"
ElseIf rst("爱好").Value = "" Then
MsgBox "/"
Else
MsgBox rst("爱好").Value
End If结果还是
runtime error '94';
invalid use of Null
并且错误行是 MsgBox rst("爱好").Value
到底怎么回事,望高手指正
该是IsNull(rst("爱好").Value)吧……
这样用不用判断Null
rst("爱好").Value & ""
txtInterest.Text=rst("爱好") & ""
IsNull(rst("爱好").Value ,"")