数据写不进ACCESS数据库
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!-- #Include File="inc/Check_Sql.asp" -->
<!-- #include file="inc/Skin_css.asp"-->
<!-- #include file="inc/config.asp" -->
<!-- #include file="Head.asp" -->
<!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=gb2312" />
<title>无标题文档</title>
</head>
<body>
<%
if trim(request("gq"))="" then response.redirect "addmsg.asp?w=1&adwh=" &request("n")
if trim(request("t1"))="" then response.redirect "addmsg.asp?w=2&adwh=" &request("n")
if trim(request("t5"))="" then response.redirect "addmsg.asp?w=3&adwh=" &request("n")
if trim(request("t4"))="" then response.redirect "addmsg.asp?w=4&adwh=" &request("n")
if trim(request("t3"))="" then response.redirect "addmsg.asp?w=5&adwh=" &request("n")
if len(request("t3"))>1000 then response.redirect "addmsg.asp?w=6&adwh=" &request("n")
%>
<p> </p>
<table width="520" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
<tr>
<td class=f14><strong><font color="#FF6600">·添加成功</font></strong></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td class=f14><div align="center">
<p><font color="#FF0000">恭喜!您的信息已经成功能添加到本站信息库!</font></p>
<p><font color="#0000FF"><a href="index.asp">返回首页</a></font></p>
</div></td>
</tr>
</table>
<%
set com=server.createobject("adodb.connection")
com.open "DBQ="& Server.MapPath("Databases/21asp.mdb") &";Driver={Microsoft Access Driver (*.mdb)};"
t1=replace(request("t1"),"<","〈")
t1=replace(t1,"'","''")
t2=replace(request("t2"),"<","〈")
t2=replace(t2,"'","‘’")
t4=replace(request("t4"),"<","〈")
t4=replace(t4,"'","‘’")
t5=replace(request("t5"),"<","〈")
t5=replace(t5,"'","‘’")
gq=replace(request("gq"),"<","〈")
gq=replace(gq,"'","‘’")
n=replace(request("n"),"<","〈")
n=replace(n,"'","‘’")
d1=replace(request("d1"),"<","〈")
d1=replace(d1,"'","''")
sz = "'" & t1 & "','" & t2 & "','" & t4 & "','" & t5 & "','" & gq & "','" & request("t3") & "','" & n &"','" & d1 &"','" & now & "',#" & dateadd("d",request("d2"),date) & "#"
if session("ad")=0 then com.Execute("INSERT INTO msg ( tit,mal,tel,lxr,gq,msg,kin,whe,tim,edt ) VALUES(" & sz & ")")
session("ad")=1%>
<p> </p>
</body>
</html>