none
ADO command對象使用疑惑 RRS feed

  • 问题

  • 使用Set recordset = command .Execute( RecordsAffected , Parameters , Options )模式,如果參數中有空的話,VB系統會自動將它轉換為8000個空格,而用 Parameters對像一個一個的給所有的非空參數賦值的話就不會有空格的問題,示例如下 :
            For i = 0 To UBound(pParams) Step 1
                If pParams(i) <> "" Then
                lCmd.Parameters.Item(i + 1).Value = pParams(i)
                End If
    next i
    我想弄清楚為什麼會這樣,有沒有更好的辦法解決空格的問題,請大家幫忙分析一下。
    以下是用perfiler抓取的到數據,請參考。
    exec aaa
    '                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
    ','51'
    2009年12月22日 1:38

全部回复