为什么会出现这样的问题,我是菜鸟,请帮忙解决!

ihjfwh 2003-06-27 11:07:21

<!-- #INGLUDE file="gbconn.asp" -->
<%
name=request("name")
email=request("email")
title=request("title")
body=request("body")

if name="" or email="" or title="" or body="" then showmessage "字段不能为空!"
response.end
End If

set rs= server.createObject("ADODB.Recordset")
sql="select * from db"
rs.open sql,conn,1,1
'set rs = getmdbrecordset("db.mdb","dd")

rs.addnew
rs("name")=name
rs("email")=email
rs("title")=title
rs("body")=body
rs.update
response.redirect "bb.asp"
%>

<%
sub showmessage(msg)
%>
<center>
<h2><%= msg %><hr></h2>
<form><input type=button value="返回上一页" onclick="history.back();"></form>
</center>
<%
end sub
%>



出现问题:

Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

ADODB.Recordset 错误 '800a0bb9'

变量或者类型不正确,或者不在可以接受的范围之内,要不就是与其他数据冲突。

/cc.asp,行15




...全文
35 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ihjfwh 2003-06-27
  • 打赏
  • 举报
回复
<%
on error resume next
dim conn
dim dbpath
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath("../data/db.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
%>
gbconn.asp是这样的,有什么冲突.
yerenamong 2003-06-27
  • 打赏
  • 举报
回复
可能你的gbconn.asp文件有与现在文件冲突
sailor001 2003-06-27
  • 打赏
  • 举报
回复
<!-- #INGLUDE file="gbconn.asp" -->
<%
name=request("name")
email=request("email")
title=request("title")
body=request("body")

if name="" or email="" or title="" or body="" then
showmessage("字段不能为空!")
response.end
End If

set rs= server.createObject("ADODB.Recordset")
sql="select * from db"
rs.open sql,conn,1,1
'set rs = getmdbrecordset("db.mdb","dd")

rs.addnew
rs("name")=name
rs("email")=email
rs("title")=title
rs("body")=body
rs.update
response.redirect "bb.asp"
%>

<%
function showmessage(msg)
%>
<center>
<h2><%= msg %><hr></h2>
<form><input type=button value="返回上一页" onclick="history.back();"></form>
</center>
<%
end function
%>

gabriel1 2003-06-27
  • 打赏
  • 举报
回复
if 和end 不配对,直觉错误应该在gbconn.asp文件中。
还有,conn,1,1该成conn,1,3
ihjfwh 2003-06-27
  • 打赏
  • 举报
回复
试了也不行
  • 打赏
  • 举报
回复
要用conn,1,3吧

28,404

社区成员

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

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