再别康桥简谱小提琴:26个日文片假名导致Access搜索(80040e14/内存溢出)

来源:百度文库 编辑:中科新闻网 时间:2024/05/07 03:34:15
26个日文片假名导致Access搜索(80040e14/内存溢出),有人说要对这26个字符进行编码和解码可以解决。但是我不知道编码和解码到底该插入哪个网页?什么位置?望高手做详细说明。

保存数据库数据时进行编码:Rs("Content")=JAPEncode(Content)
读取数据库数据时进行解码:Content=JAPUncode(Rs("Content"))
'================================================
'函数名:JAPEncode
'作 用:日文片假名编码
'参 数:str ----原字符
'================================================
Public Function JAPEncode(ByVal str)
Dim FobWords, i
On Error Resume Next
If IsNull(str) Or Trim(str) = "" Then
JAPEncode = ""
Exit Function
End If
FobWords = Array(92, 304, 305, 430, 431, 437, 438, 12460, 12461, 12462, 12463, 12464, 12465, 12466, 12467, 12468, 12469, 12470, 12471, 12472, 12473, 12474, 12475, 12476, 12477, 12478, 12479, 12480, 12481, 12482, 12483, 12485, 12486, 12487, 12488, 12489, 12490, 12496, 12497, 12498, 12499, 12500, 12501, 12502, 12503, 12504, 12505, 12506, 12507, 12508, 12509, 12510, 12521, 12532, 12533, 65340)
For i = 1 To UBound(FobWords, 1)
If InStr(str, ChrW(FobWords(i))) > 0 Then
str = Replace(str, ChrW(FobWords(i)), "&#" & FobWords(i) & ";")
End If
Next
JAPEncode = str
End Function
'================================================
'函数名:JAPUncode
'作 用:日文片假名解码
'参 数:str ----原字符
'================================================
Public Function JAPUncode(ByVal str)
Dim FobWords, i
On Error Resume Next
If IsNull(str) Or Trim(str) = "" Then
JAPUncode = ""
Exit Function
End If
FobWords = Array(92, 304, 305, 430, 431, 437, 438, 12460, 12461, 12462, 12463, 12464, 12465, 12466, 12467, 12468, 12469, 12470, 12471, 12472, 12473, 12474, 12475, 12476, 12477, 12478, 12479, 12480, 12481, 12482, 12483, 12485, 12486, 12487, 12488, 12489, 12490, 12496, 12497, 12498, 12499, 12500, 12501, 12502, 12503, 12504, 12505, 12506, 12507, 12508, 12509, 12510, 12521, 12532, 12533, 65340)
For i = 1 To UBound(FobWords, 1)
If InStr(str, "&#" & FobWords(i) & ";") > 0 Then
str = Replace(str, "&#" & FobWords(i) & ";", ChrW(FobWords(i)))
End If
Next
str = Replace(str, Chr(0), "")
str = Replace(str, "'", "''")
JAPUncode = str
End Function