2个回答
展开全部
这个问题是ACCESS固有的BUG,不能从根本上解决,建议将日文通过字符变换进行存储,显示时再转换过来,方法有:
server.HTMLencode()
server.HTMLdecode()
或者有最简单的办法:escape()、unescape()
实例:
如要在ACCESS数据库中存储日文片假名XXX,则存储时使用:escape(xxx),取出时用unescape(xxx)。
=====================
如果以上不能解决问题,建议用下面的函数进行变换:
Function EncodeJP(StrHTML)
StrHTML=Replace(StrHTML,"ガ","")
StrHTML=Replace(StrHTML,"ギ","")
StrHTML=Replace(StrHTML,"ア","")
StrHTML=Replace(StrHTML,"ゲ","")
StrHTML=Replace(StrHTML,"ゴ","")
StrHTML=Replace(StrHTML,"ザ","")
StrHTML=Replace(StrHTML,"ジ","")
StrHTML=Replace(StrHTML,"ズ","")
StrHTML=Replace(StrHTML,"ゼ","")
StrHTML=Replace(StrHTML,"ゾ","")
StrHTML=Replace(StrHTML,"ダ","")
StrHTML=Replace(StrHTML,"ヂ","")
StrHTML=Replace(StrHTML,"ヅ","")
StrHTML=Replace(StrHTML,"デ","")
StrHTML=Replace(StrHTML,"ド","")
StrHTML=Replace(StrHTML,"バ","")
StrHTML=Replace(StrHTML,"パ","")
StrHTML=Replace(StrHTML,"ビ","")
StrHTML=Replace(StrHTML,"ピ","")
StrHTML=Replace(StrHTML,"ブ","")
StrHTML=Replace(StrHTML,"ブ","")
StrHTML=Replace(StrHTML,"プ","")
StrHTML=Replace(StrHTML,"ベ","")
StrHTML=Replace(StrHTML,"ペ","")
StrHTML=Replace(StrHTML,"ボ","")
StrHTML=Replace(StrHTML,"ポ","")
StrHTML=Replace(StrHTML,"ヴ","")
EncodeJP=StrHTML
End Function
将这个数据库循环变换
set rs=server.createObject("adodb.recordset")
rs.open "查询语句",conn,1,2
do while not rs.eof
rs("content")=EncodeJP( rs("content"))'此处为举例
rs.update
rs.movenext
loop
rs.close
set rs=nothing
server.HTMLencode()
server.HTMLdecode()
或者有最简单的办法:escape()、unescape()
实例:
如要在ACCESS数据库中存储日文片假名XXX,则存储时使用:escape(xxx),取出时用unescape(xxx)。
=====================
如果以上不能解决问题,建议用下面的函数进行变换:
Function EncodeJP(StrHTML)
StrHTML=Replace(StrHTML,"ガ","")
StrHTML=Replace(StrHTML,"ギ","")
StrHTML=Replace(StrHTML,"ア","")
StrHTML=Replace(StrHTML,"ゲ","")
StrHTML=Replace(StrHTML,"ゴ","")
StrHTML=Replace(StrHTML,"ザ","")
StrHTML=Replace(StrHTML,"ジ","")
StrHTML=Replace(StrHTML,"ズ","")
StrHTML=Replace(StrHTML,"ゼ","")
StrHTML=Replace(StrHTML,"ゾ","")
StrHTML=Replace(StrHTML,"ダ","")
StrHTML=Replace(StrHTML,"ヂ","")
StrHTML=Replace(StrHTML,"ヅ","")
StrHTML=Replace(StrHTML,"デ","")
StrHTML=Replace(StrHTML,"ド","")
StrHTML=Replace(StrHTML,"バ","")
StrHTML=Replace(StrHTML,"パ","")
StrHTML=Replace(StrHTML,"ビ","")
StrHTML=Replace(StrHTML,"ピ","")
StrHTML=Replace(StrHTML,"ブ","")
StrHTML=Replace(StrHTML,"ブ","")
StrHTML=Replace(StrHTML,"プ","")
StrHTML=Replace(StrHTML,"ベ","")
StrHTML=Replace(StrHTML,"ペ","")
StrHTML=Replace(StrHTML,"ボ","")
StrHTML=Replace(StrHTML,"ポ","")
StrHTML=Replace(StrHTML,"ヴ","")
EncodeJP=StrHTML
End Function
将这个数据库循环变换
set rs=server.createObject("adodb.recordset")
rs.open "查询语句",conn,1,2
do while not rs.eof
rs("content")=EncodeJP( rs("content"))'此处为举例
rs.update
rs.movenext
loop
rs.close
set rs=nothing
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
应该不会有这个问题的,你把你的代码贴出。记得acess的like用法和sql的不一样~通配符不一样
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询