中午研究了一下,找到问题所在了,如下:
conn.asp
<%
set conn=server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath("data.mdb")
conn.open connstr
%>
jzxx.asp
<%IF Request.QueryString("actionstr")="add" Then%>
<!--#include file=conn1.asp -->
<%
dim Name,Unit,Address,Phone,Fax,Email,Others,Message
set rs=server.createobject("adodb.recordset")
sqltext="select * from Message"
rs.open sqltext,conn,1,3
'添加一个留言到数据库
rs.addnew
rs("Name")=request.form("Name")
rs("Unit")=request.form("Unit")
rs("Address")=request.form("Address")
rs("Phone")=request.form("Phone")
rs("Fax")=request.form("Fax")
rs("Email")=request.form("Email")
rs("Others")=request.form("Others")
rs("Message")=request.form("Message")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.Write("<center><meta http-equiv='refresh' content='3;URL=jzxx.asp'><BR><BR><a href='jzxx.asp'>添加成功点击返回或三秒
后自动返回</a></center>")
response.end
else
%>
<HTML><HEAD><TITLE>淄博卫生</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="images/style.css" type=text/css rel=stylesheet>
<STYLE type=text/css>
.main_tab {
BORDER-RIGHT: gray 0px solid; BORDER-LEFT: #ffffff 0px solid; COLOR: #000000; BORDER-BOTTOM: gray 0px solid;
BACKGROUND-COLOR: #d4d0c8
}
body {
background-image: url(images/bg10.gif);
}
.STYLE3 {
font-size: 14px;
font-weight: normal;
}
.style4 {
font-size: 16px;
font-family: "黑体";
}
.style5 {color: #FF0000}
.style7 {font-size: 16px}
.style8 {font-weight: bold; font-family: "黑体";}
.style10 {font-size: 14}
</STYLE>
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<script type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
</HEAD>
<BODY bgColor=#474747 leftMargin=0 topMargin=0>
<!-- #include file="TOP.asp" -->
<TABLE cellSpacing=0 cellPadding=0 width=778 align=center bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD vAlign=top align=left colSpan=6 height=4></TD>
</TR>
<TR>
<TD vAlign=top align=left width=72 height=100><SCRIPT language=javascript>
function newWin(url){
window.open(url,"_blank","");
}
function search(){
var sKeyword = keyword.value
if (sKeyword == ""){
alert("输入的关键词不能为空!")
return ;
}
var sCategory = category.value;
var sPath = "../znss/index.asp?keyword="+ sKeyword+"&category="+sCategory;
var sPath = "../znss/index.asp?keyword="+ sKeyword
newWin(sPath)
}
document.onkeydown=function(){
if (event.keyCode!=13) return
if (event.srcElement.name=="textfield"){
search();
}
else{
event.keyCode=9
}
}
</SCRIPT>
</TD>
<TD vAlign=top align=left colSpan=3></TD>
<TD vAlign=top align=left width=657 height=100><TABLE height="311%" cellSpacing=0 cellPadding=0 width=601 border=0>
<TBODY>
<TR>
<TD height="13"><p class="style7"><br>
<span class="style8">局长信箱:</span></p>
<p class="STYLE3"> 感谢您对淄博市卫生工作的关心,请提出您的意见或建议。
<br>
<br>
注:(*)为必添项目</p>
<form name="form1" method="post" action="jzxx.asp?actionstr=add"> '这后面的encType=text/plain是不能要滴。
<table width="512" height="314" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="131" align="center" class="STYLE3">
<label>姓名:</label>
</td>
<td colspan="2" class="STYLE3">
<input name="Name" type="text" id="Name" size="33">
*</td>
</tr>
<tr>
<td align="center" class="STYLE3">
<label>单位:</label>
</td>
<td colspan="2" class="STYLE3">
<input name="Unit" type="text" id="Unit" size="33">
*</td>
</tr>
<tr>
<td align="center" class="STYLE3">
<label>地址:</label>
</td>
<td colspan="2" class="STYLE3">
<input name="Address" type="text" id="Address" size="33">
*</td>
</tr>
<tr>
<td align="center" class="STYLE3">
<label>电话:</label>
</td>
<td colspan="2" class="STYLE3">
<input name="Phone" type="text" id="Phone" size="33">
</td>
</tr>
<tr>
<td align="center" class="STYLE3">
<label>传真:</label>
</td>
<td colspan="2" class="STYLE3">
<input name="Fax" type="text" id="Fax" size="33">
</td>
</tr>
<tr>
<td align="center" class="STYLE3">
<label>电子邮件:</label>
</td>
<td colspan="2" class="STYLE3">
<input name="Email" type="text" id="Email" size="33">
*</td>
</tr>
<tr>
<td align="center" class="STYLE3">
<label>其它联系方式:</label>
</td>
<td colspan="2" class="STYLE3">
<input name="Others" type="text" id="Others" size="33">
</td>
</tr>
<tr>
<td height="102" align="center" class="STYLE3">
<label>你的意见:</label>
</td>
<td height="102" colspan="2" class="STYLE3">
<textarea name="Message" cols="37" rows="10" id="Message"></textarea>
</td>
</tr>
<tr>
<td height="18" align="center"> </td>
<td width="227" height="18" align="left" class="STYLE3">
<input name="submit2" type="submit" id="queding2" value="确定">
</td>
<td width="154" align="left" class="STYLE3">
<input name="chongzhi" type="reset" id="chongzhi" value="重置">
</td>
</tr>
<tr>
<td height="16" colspan="3" align="center"> </td>
</tr>
<tr>
<td height="14" colspan="3" align="center"> </td>
</tr>
</table>
</form>
<p class="STYLE3"> </p>
<p class="STYLE3"> </p></TD>
</TR>
<TR>
<TD vAlign=center align=middle background=images/body_02.gif
height=13> </TD>
</TR>
<TR>
<TD vAlign=top align=middle background=义乌市卫生局.files/body_02.gif
height=4><IMG height=4 src="images/body_line.gif"
width=588></TD>
</TR>
<TR>
<TD background=义乌市卫生局.files/body_02.gif height="100%"></TD>
</TR>
<TR>
<TD height=10><IMG height=10 src="images/body_03.gif" width=601></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>
<br>
<!-- #include file="FT.asp" --></BODY></HTML>
<%end if%>
[此贴子已经被作者于2006-8-21 14:18:48编辑过]