10904.html

来自「VB技巧问答10000例 VB技巧问答10000例」· HTML 代码 · 共 23 行

HTML
23
字号
<html>
  <head>
    <title>Re: 字串和数字有 Null ?</title>
  </head>
  <body bgcolor="#FFFFFF" vlink="#808080">
    <center>
      <h1>Re: 字串和数字有 Null ?</h1>
    </center>
<hr size=7 width=75%>

<hr size=7 width=75%><p>
Posted by <a href="mailto:wyw@iName.com">OO</a> on March 12, 1999 at 16:01:48:<p>
In Reply to: <a href="10843.html">Re: 字串和数字有 Null ?</a> posted by 王空空 on March 10, 1999 at 12:46:35:<p>
可以写个小程式来处理读入资料转成 SQL 的栏位值.<p>Function FieldValue(Value As Variant) As String<br>    Select Case VarType(Value)<br>    Case vbEmpty, vbNull<br>        strRet = "Null"<br>    Case vbInteger, vbLong, vbSingle, vbDouble, vbCurrency, vbDecimal, vbByte<br>        strRet = Value<br>    Case vbString<br>        If Len(Value) = 0 Then<br>            strRet = "Null"<br>        Else<br>            strRet = """" & Value & """"<br>        End If<br>    Case vbBoolean<br>        strRet = IIf(Value, "True", "False")<br>    End Select<br>    FieldValue = strRet<br>End Function<br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 10904-->
</ul><!--end: 10904-->
<br><hr size=7 width=75%><p>

</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?