ASP从数据库中读出数据用Response.write写出中文为什么是乱码!
这是我写的代码;那位大侠给咱看看.给个解决的方法<<%@LANGUAGE='VBSCRIPT'CODEPAGE='936'%><html><head><metaname=...
这是我写的代码;那位大侠给咱看看.给个解决的方法
<<%@LANGUAGE='VBSCRIPT' CODEPAGE='936' %>
<html>
<head>
<meta name="robots" content="noindex,nofollow" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<link href="Style.css" rel="stylesheet" type="text/css" />
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<%
dim fsj
Dim oRS,oConn
Set oRS = Server.CreateObject("ADODB.Recordset")
Set oConn= Server.CreateObject("ADODB.Connection")
oConn.ConnectionString="Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("xw.mdb")
oConn.Open
oRS.open "SELECT DISTINCT sj FROM xw" ,oconn,2,3
Response.write "<form name='form' method='post' action='ss.asp'>"
Response.write "<p>选择时间:"
Response.write "<select name='sj'>"
do while not ors.eof
temp=Server.URLEncode(ors("sj"))
Response.write "<option>" & Mid(temp,1,4) & "-" & mid(temp,8,2) & "-" & mid(temp,13) & "</option>"
ors.movenext
loop
Response.write "<input type='submit' name='Submit' value='显示'>"
Response.write "</select>"
orS.close
fsj=Request.Form("sj")
if fsj<>"" then
oRS.open "SELECT * FROM xw where str(sj)='" & fsj & "'" ,oconn,2,3
do while not ors.eof
Response.write Server.URLEncode(ors("bt")) & " "
ors.movenext
loop
end if
%>
</body>
</html> 展开
<<%@LANGUAGE='VBSCRIPT' CODEPAGE='936' %>
<html>
<head>
<meta name="robots" content="noindex,nofollow" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<link href="Style.css" rel="stylesheet" type="text/css" />
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<%
dim fsj
Dim oRS,oConn
Set oRS = Server.CreateObject("ADODB.Recordset")
Set oConn= Server.CreateObject("ADODB.Connection")
oConn.ConnectionString="Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("xw.mdb")
oConn.Open
oRS.open "SELECT DISTINCT sj FROM xw" ,oconn,2,3
Response.write "<form name='form' method='post' action='ss.asp'>"
Response.write "<p>选择时间:"
Response.write "<select name='sj'>"
do while not ors.eof
temp=Server.URLEncode(ors("sj"))
Response.write "<option>" & Mid(temp,1,4) & "-" & mid(temp,8,2) & "-" & mid(temp,13) & "</option>"
ors.movenext
loop
Response.write "<input type='submit' name='Submit' value='显示'>"
Response.write "</select>"
orS.close
fsj=Request.Form("sj")
if fsj<>"" then
oRS.open "SELECT * FROM xw where str(sj)='" & fsj & "'" ,oconn,2,3
do while not ors.eof
Response.write Server.URLEncode(ors("bt")) & " "
ors.movenext
loop
end if
%>
</body>
</html> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询