asp+access写入时乱码
<html><head><title>通讯录</title></head><body><tablewidth="100%"border="0"cellspacing="0...
<html>
<head>
<title>通讯录</title>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<form method="post" action="jr.asp" >
<tr>
<td align="center">姓 名</td>
<td><input name="name" type="text" class="input_text" id="name" size="19"></td>
</tr>
<tr>
<td align="center">号 码</td>
<td><input name="cellphone" type="text" class="input_text" id="cellphone" size="19"></td>
</tr>
<tr>
<td align="center">通信地址</td>
<td><input name="dizhi" type="text" class="input_text" id="dizhi" size="19"></td>
</tr>
<tr>
<td align="center">个人爱好</td>
<td><input name="aihao" type="text" class="input_text" id="aihao" size="19"></td>
</tr>
<tr>
<td align="center">所在大学</td>
<td><input name="univer" type="text" class="input_text" id="univer" size="19"></td>
</tr>
<tr>
<td align="center">备 注</td>
<td><input name="beizhu" type="text" class="input_text" id="beizhu" size="19"></td>
</tr>
<tr>
<td align="center">班 级</td>
<td><input name="class1" type="text" class="input_text" id="class1" size="19"></td>
</tr>
<tr align="center">
<td><input type=submit value="提交">
<input type=reset value="重设">
</td>
</tr>
</form>
</table>
</body>
</html>
jr.asp
<html>
<head>
<title>通讯录</title>
</head>
<body>
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("data.mdb")
sql="select * from tongxun"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
rs("name")=Request.Form("name")
rs("cellphone")=Request.Form("cellphone")
rs("dizhi")=Request.Form("dizhi")
rs("aihao")=Request.Form("aihao")
rs("univer")=Request.Form("univer")
rs("beizhu")=Request.Form("beizhu")
rs("class1")=Request.Form("class1")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</body>
</html>
但文本框中的中文输入到数据库之后却变成了乱码??数据库是Access.用英文时就不会。请问,这是怎么回事呀??? 展开
<head>
<title>通讯录</title>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<form method="post" action="jr.asp" >
<tr>
<td align="center">姓 名</td>
<td><input name="name" type="text" class="input_text" id="name" size="19"></td>
</tr>
<tr>
<td align="center">号 码</td>
<td><input name="cellphone" type="text" class="input_text" id="cellphone" size="19"></td>
</tr>
<tr>
<td align="center">通信地址</td>
<td><input name="dizhi" type="text" class="input_text" id="dizhi" size="19"></td>
</tr>
<tr>
<td align="center">个人爱好</td>
<td><input name="aihao" type="text" class="input_text" id="aihao" size="19"></td>
</tr>
<tr>
<td align="center">所在大学</td>
<td><input name="univer" type="text" class="input_text" id="univer" size="19"></td>
</tr>
<tr>
<td align="center">备 注</td>
<td><input name="beizhu" type="text" class="input_text" id="beizhu" size="19"></td>
</tr>
<tr>
<td align="center">班 级</td>
<td><input name="class1" type="text" class="input_text" id="class1" size="19"></td>
</tr>
<tr align="center">
<td><input type=submit value="提交">
<input type=reset value="重设">
</td>
</tr>
</form>
</table>
</body>
</html>
jr.asp
<html>
<head>
<title>通讯录</title>
</head>
<body>
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("data.mdb")
sql="select * from tongxun"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
rs("name")=Request.Form("name")
rs("cellphone")=Request.Form("cellphone")
rs("dizhi")=Request.Form("dizhi")
rs("aihao")=Request.Form("aihao")
rs("univer")=Request.Form("univer")
rs("beizhu")=Request.Form("beizhu")
rs("class1")=Request.Form("class1")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</body>
</html>
但文本框中的中文输入到数据库之后却变成了乱码??数据库是Access.用英文时就不会。请问,这是怎么回事呀??? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询