asp中的英文的'写不进数据库

来源:百度知道 编辑:UC知道 时间:2024/05/27 19:33:20
asp中的英文的'写不进数据库
其他的符号比如<>/之类都可以写入,可是一旦有英文的'时候,就不行;
页面的语言已经设置成了西欧!
info=replace(request("info"),">",">")
info=replace(info,"<","<")
info=replace(info,"'","'")
conn.execute "update product set info='"&info&"'where id=" & id
使用的是access数据库!!
如果输入',则变成了本次更新没操作一样!数据库不变

'的作用在asp里是注释,相当于注释了后面的代码当然不能正常运行了,建议使用
info=replace(request("info"),chr(39),"‘")
应该就可以录入了,输出的时候要用
replace(rs("info"),"‘",chr(39))来还原, 可以写
response.write (replace(rs("info"),"‘",chr(39)))

conn.execute "update product set info='"&info&"'where id=" & id & "'"这样吧。