急!向数据库中插入数据有错误!提示“内部服务器错误”
急!向数据库中插入数据有错误!提示“内部服务器错误”
快救我!
代码如下:
conn.asp:
<%
dim conn
dim connstr
on error resume next
connstr="DBQ="+server.mappath("rt.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>
guest.asp为纯html代码,递交到guestsave.asp。
guestsave.asp
<!-- #include file="conn.asp"-->
<%
set rs=Server.CreateObject("Adodb.Recordset"))
sql="select * from rt"
rs.open sql,conn,1,3
rs.Addnew
rs("ywy")=Request.Form("ywy")
rs("idate")=Request.Form("idate")
rs("gcompany")=Request.Form("gcompany")
rs("frdb")=Request.Form("frdb")
rs("zw")=Request.Form("zw")
rs("tel")=Request.Form("tel")
rs("bfsj")=Request.Form("bfsj")
rs("address")=Request.Form("address")
rs("gaist")=Request.Form("gaist")
rs("kfdj")=Request.Form("kfdj")
rs("gtfs")=Request.Form("gtfs")
rs("content")=Request.Form("content")
rs("xyjg")=Request.Form("xyjg")
rs("bz")=Request.Form("bz")
rs("zgqz")=Request.Form("zgqz")
rs.update
conn.close
set conn=nothing
rs.close
set rs=nothing
%><head>
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#993399" bgcolor="#CCCCCC" class="css">
<tr class="css">
<td width="6%" height="25" align="center">业务员</td>
<td width="6%" align="center">记录时间</td>
<td width="6%" align="center">客户公司</td>
<td width="6%" align="center">法人代表联系人</td>
<td width="6%" align="center">职务</td>
<td width="7%" align="center">电话</td>
<td width="7%" align="center">拜访时间</td>
<td width="7%" align="center">公司地址</td>
<td width="7%" align="center">客户等级</td>
<td width="7%" align="center">沟通方式</td>
<td width="7%" align="center">沟通内容</td>
<td width="7%" align="center">协议金额</td>
</tr>
<%
set rs1=Server.CreateObject("Adodb.Recordset")
sql="select * from rt where gcompany ='"&request("gcompany")&"'"
rs1.open sql,conn,1,1
do while not rs.eof
Response.Write"<tr>"
Response.Write"<td>"&rs("ywy")&"</td>"
Response.Write"<td>year("idate")"年"month("idate")"月"day("idate")"日"</td>"
Response.Write"<td><a href=company.asp?id=<%=rs("id")%>>&rs("gcompany")&"</a></td>"
Response.Write"<td>"&rs("frdb")&"</td>"
Response.Write"<td>"&rs("zw")&"</td>"
Response.Write"<td>"&rs("tel")&"</td>"
Response.Write"<td>"&rs("bfsj")&"</td>"
Response.Write"<td>"&rs("address")&"</td>"
Response.Write"<td>"&rs("kfdj")&"</td>"
Response.Write"<td>"&rs("gtfs")&"</td>"
Response.Write"<td>"&rs("content")&"</td>"
Response.Write"<td>"&rs("xyjg")&"</td>"
Response.Write"</tr>"
rs1.movenext
loop
Response.write"</table>"
conn.close
set conn=nothing
rs.close
set rs=nothing
%>