Last active
July 17, 2017 08:01
-
-
Save relyky/01bc644c5c0ed2405492 to your computer and use it in GitHub Desktop.
VB6, IsNull, 在VB6中出現"NULL值使用不正確"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'# 在VB6中出現"NULL值使用不正確" | |
'# 參考文章http://www.blueshop.com.tw/board/FUM200501271723350KG/BRD200512090832443X3.html | |
'# 法一:使用 IIF 與 IsNull 函數 | |
'# [變數] = IIf(IsNull([變數]), [預設值], [變數]) | |
field_value = IIf(IsNull(rs.Fields(9).Value), "", rs.Fields(9).Value) | |
'# 法二: 串接空字串 | |
'# 變數 = Trim(變數 & "") | |
field_value = rs.Fields(9).Value & "" | |
' 註:此例中 rs 是VB6的Recordset物件 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment