日期:2014-05-17  浏览次数:20878 次

乱码噢...愁银...怎么办啊!
代码如下,从access数据库中取出数据赋值给变量a,页面输出a时(<div id="aadiv"><%=a%></div>)是乱码,如果把charset=utf-8改成charset=GB2312可以正常输出,但是页面其它文字又变成了乱码,怎么办啊?求教好心人帮忙改下代码啦!!!!!

<%@ Language="VBScript" CODEPAGE="936"%>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.open "DRIVER=Driver do Microsoft Access (*.mdb);UID=admin;PWD=;DBQ="&Server.MapPath("mydb.mdb")
set rst=Server.CreateObject("ADODB.recordset")
rst.open "select * from mytable1 where id=" & request.QueryString("id"),conn,1,1
if rst.recordcount>0 then
a=rst("adress")

end if
rst.close
set rst=nothing
conn.close
set conn=nothing
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


------解决方案--------------------
唉,终于找了个图床来上传这张图给你看