asp读取数据库出现中文乱码

代码:<%@LANGUAGE="VBSCRIPT"CODEPAGE="65001"%><head><metahttp-equiv="Content-Type"conten... 代码: <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body> </body> </html> <% dim connstr,zdm,rc,comm,zystr,jstr,dstr,bhstr on error resume next set conn=server.createobject("adodb.connection") ConnString = "DRIVER={Microsoft Access Driver (*.mdb)}; " ConnString = ConnString & "DBQ=" & Server.MapPath("aa.mdb") conn.open connstring set rs=server.createobject("adodb.recordset") sql="select * from gzgl" rs.open sql,conn,1,3 comm=request.Form("comm") zystr=request.Form("zy") jstr=request.Form("j") dstr=request.Form("d") bhstr=request.Form("bh") select case comm case "insert" rs.addnew rs("zy")=zystr rs("j")=jstr rs("d")=dstr rs.update Response.Write("ok") case "delect" rs.find "bh =" & bhstr if not rs.eof then rs.delete Response.Write("ok") else Response.Write("err") end if case "update" rs.find "bh =" & bhstr if not rs.eof then rs("zy") = zystr rs("j") = jstr rs("d") = dstr rs.update Response.Write("ok") else Response.Write("err") end if end select rs.movelast Response.Write("&count="&rs.recordcount) for rc=1 to rs.recordcount for zdm=0 to rs.fields.count-1 Response.Write("&") Response.Write(rs(zdm).name) Response.Write(rc) Response.Write("=") Response.Write(rs(zdm)) next rs.moveprevious next rs.close set rs=nothing conn.close %> 结果: &count=3&bh1=3&rq1=2012-2-9&zy1=kh&j1=0&d1=0&bh2=2&rq2=2012-2-8&zy2=ˆ?Ŀ??Ḑ&j2=0&d2=0&bh3=1&rq3=2012-2-8&zy3=?ط?&j3=324&d3=82 展开
 我来答
骑真拱浩丽
2019-02-27 · TA获得超过3557个赞
知道大有可为答主
回答量:3120
采纳率:25%
帮助的人:156万
展开全部
完整的应该是,在asp
页头添加如下代码:
<%@
CODEPAGE=65001
%>
<%
Response.CodePage=65001%>
<%
Response.Charset="UTF-8"
%>
用写字板把
.asp
文件另存为
utf-8
字符集
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式