asp页面更新数据库错误 -----求大神指点。。。

Janus512 2012-05-26 09:56:15
write.asp代码如下:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="conn.asp"-->
<%
dim xianhe
xianhe=session("xianhe")
if xianhe="" then
response.Redirect"xh_login.asp"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>录入新闻</title>
</head>
<body>
<p> </p>
<form action="save.asp" method="post" name="form1">
<!--#include file="../head.asp"-->
<table width="900" border="0" align="center" cellspacing="0">
<tr>
<td colspan="2" align="center" bgcolor="#DAE1E9"><h2>新闻录入</h2></td>
</tr>
<tr>
<td width="310" align="right">新闻标题:</td>
<td width="586" align="left"><input name="title" type="text" id="title" size="35" /></td>
</tr>
<tr>
<td align="right">录入时间:</td>
<td align="left"><%=now()%></td>
</tr>
<tr>
<td height="105" align="right">新闻内容:</td>
<td align="left"><textarea name="content" id="content" cols="50" rows="7"></textarea></td>
</tr>
<tr>
<td align="right">编写员:</td>
<td align="left"><input name="wname" type="text" id="wname" size="10" /></td>
</tr>
</table>
<table width="900" border="0" align="center" cellspacing="0">
<tr>
<td align="center"><input type="submit" name="button" id="button" value="提交" />  
<input type="reset" name="button2" id="button2" value="重新输入" /></td>
</tr>
</table>
<!--#include file="../end.asp"-->
</form>

</body>
</html>


save.asp代码如下:

<!--#include file="conn.asp"-->
<%
dim xianhe
xianhe=session("xianhe")
if xianhe="" then
response.Redirect "login.asp"
end if
%>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from fbnew"
rs.open sql,db,1,3
rs.addnew
rs("title")=trim(request.Form("title"))
rs("wname")=trim(request.Form("wname"))
rs("content")=server.HTMLEncode(request.Form("content")
rs("xwcount")=0
rs("xtime")=now()
rs.update
rs.close
db.close
set rs=noting
set db=noting
response.Redirect "add.asp"
%>


头文件的代码如下:
<%
set db=server.CreateObject("adodb.connection")
db.open "DBQ="&server.MapPath("../new.mdb")&";driver={microsoft access driver (*.mdb)}"
%>


数据库中表fbnew的列分别为:id,name,content,xwcount,xwtime,title。

write.asp往save.asp提交时出现500错误。。 求大神指点。。。
...全文
128 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
001007009 2012-05-27
  • 打赏
  • 举报
回复
什么格式 具体错误内容?
Janus512 2012-05-27
  • 打赏
  • 举报
回复
格式有问题? 求解析。。。
snlixing 2012-05-27
  • 打赏
  • 举报
回复
你的代码格式有问题,写的不规范
snlixing 2012-05-27
  • 打赏
  • 举报
回复
打开浏览器的internet选项——高级——显示友好http错误的勾去掉,就能看到具体错误了
Janus512 2012-05-27
  • 打赏
  • 举报
回复
write.asp页面可以正常显示 save.asp不能预览。提交时出现提示错误:内部服务器500错误,没有提示哪一行出错
001007009 2012-05-26
  • 打赏
  • 举报
回复
显示详细错误信息 ,看具体是什么错误 哪一行?
一只小老贺 2012-05-26
  • 打赏
  • 举报
回复
IIS设置显示错误信息,适当的时候加上err调试语句

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧