| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 404 人关注过本帖
标题:一个ASP留言板报错程序
只看楼主 加入收藏
zln
Rank: 1
等 级:新手上路
帖 子:73
专家分:0
注 册:2006-1-6
收藏
 问题点数:0 回复次数:3 
一个ASP留言板报错程序

出错显示:provider=microsoft.jet.oledb.4.0;datasource=I:\zln\board.mdb
sendms.aps源程序:

<html>
<head>
<title>留言薄</title>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<script language="javascript">
<!--
function firstisspace(mystring)
{var istring=mystring;
var temp,i,strlen;
temp=false;
if(istring.substring(0,1)=="")
{temp=true;}
return temp;
}
function isemail(mystring)
{var istring=mystring;
var atpos=mystring.indexOf("@");
var temp=true;
if(atpos==-1)
{temp=false;}
return temp;
}
function check_input(theForm)
{if((theForm.name.value=="")|(firstisspace(theForm.name.value)))
{alert("please input your name,can't have blank in the front!");
theForm.name.focus();
return(false);
}
if((theForm.email.value!="")&(!isemail(theForm.email.value)))
{alert("email isn't crrect,please retry!");
theForm.email.focus();
return(false);
}
if(theForm.title.value=="")
{alert("please input mssenger title!");
theForm.title.focus();
return(false);
}
if(theForm.content.value=="")
{alert("please input mssenger content!");
theForm.content.focus();
return(false);
}
return(true);
}
file://-->
</script>
</head>
<body>
<center>
留言薄 <br>
<form name="form1"method="post" action="sendmsok.asp"onsubmit="return check_input(this)">
<table width="500" border="1">
<tr align="center">
<td height="30" colspan="2"><a href="viewms.asp">查看留言</a></td>
</tr>
<tr>
<td height="30" colspan="2">您的姓名:
<input name="name" type="text"id="name"size="20"maxlength="20"></td>
</tr>
<tr>
<td height="30" colspan="2">
<p>您的email:
<input name="email"type="text"id="email"size="30"maxlength="50">
</p></td>
</tr>
<tr>
<td height="30" colspan="2">留言标题:
<input name="title" type="text" id="title" size="50"maxlength="100"></td>
</tr>
<tr>
<td height="130" colspan="2">留言内容:<br>
<textarea name="content" cols="70" rows="6" id="content"></textarea></td>
</tr>
<tr align="center">
<td><input type="submit" name="submit" value="留言"></td>
<td><input type="reset" name="reset" id="reset" value="重写"></td>
</tr>
</table>
</form>
</center>
</body>
</html>


</head>
</html>
sendmsok.asp源代码:
<%
set db=server.createobject("adodb.connection")
connstr="provider=microsoft.jet.oledb.4.0;datasource="&server.mappath("board.mdb")
response.write(connstr)
db.open connstr
name=request.form("name")
email=request.form("email")
title=request.form("title")
content=request.form("content")
sqlstr="insert into msboard(name,email,title,content) values('"&name&"','"&email&"','"&title&"','"&content&"')"
response.write(sqlstr)
db.execute sqlstr
db.close
response.redirect("viewms.asp")
%>
viewms.asp代码:
<!--#include file="config.inc"-->
<!--#include file="adobvs.inc"-->
<%
set db=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
connstr="provider=microsoft.jet.oledb.4.0;datasource="&server.mappath("board.mdb")
response.write(connstr)
db.open connstr
sqlstr="select* from vmsboard order by datetime DESC"
rs.open sqlstr,db,adopenstatic
rsnum=rs.recordcount
if request("page")=""then
currentpage=1
else
currentpage=request("page")-0
end if
if rsnum <>0 then
rs.pagesize=3
rs.absolutepage(currentpage)
end if
%>
<html>
<head>
<title>查看留言薄</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
</head>
<body>
<center>
查看留言薄<br>
<table width="500" border="1">
<tr align="center">
<td height="30"><a href="sendms.htm">我要留言</a></td>
</tr>
<%if rsnum=0 then %>
<tr>
<td height="30">没有留言</td>
</tr>
<%else
rownum=1
while not rs.eof and rownum <pagesize
name=rs("name")
email=rs("email")
title=rs("title")
content=rs("content")
if content<>""then
content=htmlencode(content)
end if
%>
<tr>
<td height="30">姓名:<%=name%></td>
</tr>
<tr>
<td height="30">
<%if email=""then%>
暂时没有email
<%else%>
Email:<a href="mailto:<%=email%>"><%=email%></a>
<%end if%>
</td>
</tr>
<tr>
<td height="30">标题:<%=title%></td>
</tr>
<tr>
<td height="100" valign="top">内容:<br><%=content%></td>
</tr>
<%rs.movenext
rownum=rownum+1
wend%>
<tr align="right">
<td>
<%if currentpage<>1 then%>

<a href="viewms.asp?page=<%=currentpage-1%>">上一页</a>
<%end if%>
&nbsp;
<%if currentpage<>rs.pagecount then%>

<a href="viewms.asp?page=<%=currentpage+1%>">下一页</a>
<%end if%>
&nbsp;
当 前 第 <%=currentpage%> 页 / 共<%=rs.pagecount%>页
</td>
</tr>
<%end if%>
</table>
<%rs.close
db.close%>
</center>
</body>
</html>
问题可能出在adobvs.inc和config.inc这两个头文件中,想请问一下这两个文件具体应该怎么写呢?

搜索更多相关主题的帖子: 留言 ASP 
2006-01-16 16:52
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
收藏
得分:0 
provider=microsoft.jet.oledb.4.0;data source=I:\zln\board.mdb
这里应该要加一个空格吧。。

中国人的财富网:http://www..cn/
2006-01-16 17:17
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
错误信息是什么
2006-01-16 17:17
qqqking
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2006-1-16
收藏
得分:0 
打个包贴出来呀,如果小的话,谁有空慢慢看呀...!
2006-01-17 10:47
快速回复:一个ASP留言板报错程序
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012760 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved