此时我们通常能想到的想法是找一个exe程序,把这个问题解决掉。我原来用C#写过这样一个类似的程序。
Google里面应该能找到我以前写的那个。就不说了。
后来某一天,我发现ASP就能实现。我当时真的觉得自己太屎了。
不过ASP的这种方法很不好。容易造成系统崩溃(如果数据库大)。
所以只是写在这里。算是抛砖引玉。
'下面我解释一下下:
Function TransferJapanDc9CnInDB()
On Error Resume Next
Err.Clear
Dim objRS,i
Set objRS=Server.CreateObject("ADODB.Recordset")
objRS.CursorType = adOpenKeyset
objRS.LockType = adLockReadOnly
objRS.ActiveConnection=objConn
objRS.Source="SELECT * FROM [blog_Comment]"
objRS.Open()
If (Not objRS.bof) And (Not objRS.eof) Then
For i=1 to objRS.RecordCount
'遍历,看看有没有日文,如果有,就溢出了,随便搜索一个东西就行了。搜什么无所谓。因为是遍历ACCESS只要指针移动到日文就溢出。
objConn.Execute("SELECT * FROM [blog_Comment] WHERE comm_ID="&objRS("comm_ID")&" AND [comm_Content] LIKE '%URL%'")
If Err.Number=-2147217900 Then
'因为是on err继续 所以这里找到溢出的错误代码,这个是自己debug出来的,实际上不是从什么地方找的。
objConn.Execute("UPDATE [blog_Comment] SET [comm_Content]='"&FilterSQL(Japan2Html(objRS("comm_Content")))&"',[comm_Author]='"&FilterSQL(Japan2Dc9CnHtml(objRS("comm_Author")))&"' WHERE comm_ID="&objRS("comm_ID")&" ")
'这个就是把日文替换一下,思路是不是很巧妙。恩。不过数据库庞大的化,反复溢出就会很出问题的。内存宝宝会哭的。
Err.Clear
End If
objRS.MoveNext
Next
End If
objRS.Close
Set objRS=Nothing
'www.dc9.cn 07/11/28
End Function
Function Japan2Dc9CnHtml(source)
source=Replace(source,"ガ","ガ")
source=Replace(source,"ギ","ギ")
source=Replace(source,"ア","ア")
source=Replace(source,"ゲ","ゲ")
source=Replace(source,"ゴ","ゴ")
source=Replace(source,"ザ","ザ")
source=Replace(source,"ジ","ジ")
source=Replace(source,"ズ","ズ")
source=Replace(source,"ゼ","ゼ")
source=Replace(source,"ゾ","ゾ")
source=Replace(source,"ダ","ダ")
source=Replace(source,"ヂ","ヂ")
source=Replace(source,"ヅ","ヅ")
source=Replace(source,"デ","デ")
source=Replace(source,"ド","ド")
source=Replace(source,"バ","バ")
source=Replace(source,"パ","パ")
source=Replace(source,"ビ","ビ")
source=Replace(source,"ピ","ピ")
source=Replace(source,"ブ","ブ")
source=Replace(source,"ブ","ブ")
source=Replace(source,"プ","プ")
source=Replace(source,"ベ","ベ")
source=Replace(source,"ペ","ペ")
source=Replace(source,"ボ","ボ")
source=Replace(source,"ポ","ポ")
source=Replace(source,"ヴ","ヴ")
Japan2Html=source
End Function
顺便说一下,最近我的blog反复被hack,搞得我很郁闷,因为是阿拉伯人或者是以色列人干的,所以没法沟通。
我还找不出来他们是怎么干的。
真的很郁闷。
好了。
接下来的日子里。我将再发布一些技术性的文章。突然感到这个位子很宝贵的说。
Google里面应该能找到我以前写的那个。就不说了。
后来某一天,我发现ASP就能实现。我当时真的觉得自己太屎了。
不过ASP的这种方法很不好。容易造成系统崩溃(如果数据库大)。
所以只是写在这里。算是抛砖引玉。
'下面我解释一下下:
Function TransferJapanDc9CnInDB()
On Error Resume Next
Err.Clear
Dim objRS,i
Set objRS=Server.CreateObject("ADODB.Recordset")
objRS.CursorType = adOpenKeyset
objRS.LockType = adLockReadOnly
objRS.ActiveConnection=objConn
objRS.Source="SELECT * FROM [blog_Comment]"
objRS.Open()
If (Not objRS.bof) And (Not objRS.eof) Then
For i=1 to objRS.RecordCount
'遍历,看看有没有日文,如果有,就溢出了,随便搜索一个东西就行了。搜什么无所谓。因为是遍历ACCESS只要指针移动到日文就溢出。
objConn.Execute("SELECT * FROM [blog_Comment] WHERE comm_ID="&objRS("comm_ID")&" AND [comm_Content] LIKE '%URL%'")
If Err.Number=-2147217900 Then
'因为是on err继续 所以这里找到溢出的错误代码,这个是自己debug出来的,实际上不是从什么地方找的。
objConn.Execute("UPDATE [blog_Comment] SET [comm_Content]='"&FilterSQL(Japan2Html(objRS("comm_Content")))&"',[comm_Author]='"&FilterSQL(Japan2Dc9CnHtml(objRS("comm_Author")))&"' WHERE comm_ID="&objRS("comm_ID")&" ")
'这个就是把日文替换一下,思路是不是很巧妙。恩。不过数据库庞大的化,反复溢出就会很出问题的。内存宝宝会哭的。
Err.Clear
End If
objRS.MoveNext
Next
End If
objRS.Close
Set objRS=Nothing
'www.dc9.cn 07/11/28
End Function
Function Japan2Dc9CnHtml(source)
source=Replace(source,"ガ","ガ")
source=Replace(source,"ギ","ギ")
source=Replace(source,"ア","ア")
source=Replace(source,"ゲ","ゲ")
source=Replace(source,"ゴ","ゴ")
source=Replace(source,"ザ","ザ")
source=Replace(source,"ジ","ジ")
source=Replace(source,"ズ","ズ")
source=Replace(source,"ゼ","ゼ")
source=Replace(source,"ゾ","ゾ")
source=Replace(source,"ダ","ダ")
source=Replace(source,"ヂ","ヂ")
source=Replace(source,"ヅ","ヅ")
source=Replace(source,"デ","デ")
source=Replace(source,"ド","ド")
source=Replace(source,"バ","バ")
source=Replace(source,"パ","パ")
source=Replace(source,"ビ","ビ")
source=Replace(source,"ピ","ピ")
source=Replace(source,"ブ","ブ")
source=Replace(source,"ブ","ブ")
source=Replace(source,"プ","プ")
source=Replace(source,"ベ","ベ")
source=Replace(source,"ペ","ペ")
source=Replace(source,"ボ","ボ")
source=Replace(source,"ポ","ポ")
source=Replace(source,"ヴ","ヴ")
Japan2Html=source
End Function
顺便说一下,最近我的blog反复被hack,搞得我很郁闷,因为是阿拉伯人或者是以色列人干的,所以没法沟通。
我还找不出来他们是怎么干的。
真的很郁闷。
好了。
接下来的日子里。我将再发布一些技术性的文章。突然感到这个位子很宝贵的说。
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“ASP代码实现自动清除替换ACCESS(MDB)数据库的日文字符的”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。