Dim i as integer
i = Null 这样不行
i = vbNullString 也不行
Dim i as integer
i = vbNull
在VB里是不允许把一个NULL值设到integer,string,boolean等变量中的!
Dim i as Variant
i = Null OK
将返回值类型改为variant行么?
只要你Dim i as integer,那么i就永远不可能为null了
下面的例子你会明白了:
Dim i As Integer
Dim j As Integer
i = Asc(vbNullChar) 这里是给integer变量赋Null值
j = Asc(0)
If i <> j Then
MsgBox "i不等于j i=" & i & " j=" & j
End If
打电话给微软,让他们把integer改成和variant一样