空值置换涵数
vb+access,编程中有没有空值置换涵数呢????
sql语句中有函数isnull(para,value) 如果para为null则返回value
vb中可以自己写一个嘛 如果等于null就返回要设定的值
Private function ReplaceNull (byval sType as string, bvval sData as string) as string
If Not sData is Null then
ReplaceNull = sData
else
Select Case sType
Case "Int"
ReplaceNull = 0
Case "String"
ReplaceNull = ""
Case "Date"
ReplaceNull = "1900/1/1"
Case "Bool"
ReplaceNull = "False"
...
End Select
end function
俺用的是vb2005 可能有些地方语法有些微差异