程式語法ASPLIKE 查詢出現執行階段錯誤 -2147217900 記憶體不足 (80040E14)

執行階段錯誤 -2147217900 - 80040e14 記憶體不足

資料庫中存入日文字元 使用具有 LIKE 子句的 SELECT 陳述式下造成執行階段錯誤出現 :

執行階段錯誤 -2147217900Microsoft JET Database Engine 80040e14 記憶體不足

嘗試從 ACEESS 裡面刪掉該筆紀錄,執行就正常,只要欄位中包含日文部份,就是會出現上面的錯誤訊息,找不到完整的方式只能暫且用 VBInStr 指令來比對過濾或替換成別的編碼。

而遇到日文會「記憶體溢出」出現 -2147217900 記憶體不足。導致出問題的 26 個日文字如下:

ゴ ガ ギ グ ゲ ザ ジ ズ ヅ デ ド ポ ベ プ ビ パ ヴ ボ ペ ブ ピ バ ヂ ダ ゾ ゼ

  • 「儲存資料時」使用 Replace 替換方法解決把 26 個日文先替換成別的自定編碼儲存。
  • 「讀取資料時」從資料庫讀取後再將自定編碼替換回原來的日本特殊字元。
Function JapaneseEncoded(fString)
  If IsNull(fString) or IsEmpty(fString) Then
    JapaneseEncoded = ""
    Exit Function
  End If
  Dim F,E,i
  F = Array("ゴ","ガ","ギ","グ","ゲ","ザ","ジ","ズ","ヅ","デ","ド","ポ","ベ","プ","ビ","パ","ヴ","ボ","ペ","ブ","ピ","バ","ヂ","ダ","ゾ","ゼ")
  E = Array("JR_A;","JR_B;","JR_C;","JR_D;","JR_E;","JR_F;","JR_G;","JR_H;","JR_I;","JR_J;","JR_K;","JR_L;","JR_M;","JR_N;","JR_O;","JR_P;","JR_Q;","JR_R;","JR_S;","JR_T;","JR_U;","JR_V;","JR_W;","JR_X;","JR_Y;","JR_Z;")
  JapaneseEncoded = fString
  For i = 0 To 25
    JapaneseEncoded = Replace(JapaneseEncoded,F(i),E(i))
  Next
End Function

Function JapaneseDecoded(fString)
  If IsNull(fString) or IsEmpty(fString) Then
    JapaneseDecoded = ""
    Exit Function
  End If
  Dim F,E,i
  F = Array("ゴ","ガ","ギ","グ","ゲ","ザ","ジ","ズ","ヅ","デ","ド","ポ","ベ","プ","ビ","パ","ヴ","ボ","ペ","ブ","ピ","バ","ヂ","ダ","ゾ","ゼ")
  E = Array("JR_A;","JR_B;","JR_C;","JR_D;","JR_E;","JR_F;","JR_G;","JR_H;","JR_I;","JR_J;","JR_K;","JR_L;","JR_M;","JR_N;","JR_O;","JR_P;","JR_Q;","JR_R;","JR_S;","JR_T;","JR_U;","JR_V;","JR_W;","JR_X;","JR_Y;","JR_Z;")
  JapaneseDecoded = fString
  For i = 0 To 25
    JapaneseDecoded = Replace(JapaneseDecoded,E(i),F(i))
  Next
End Function

修正 6.1.0.9774Expsrv.dll 檔案 http://support.microsoft.com/kb/834399
但似乎沒有找到解決 ASP 的修正方式或更新檔案。