标题:[求助]小弟求助
只看楼主
yqhxc
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-11-5
 问题点数:0 回复次数:4 
[求助]小弟求助

我的出现这样的错误,请大虾指点
错误类型:
Microsoft VBScript 编译器错误 (0x800A0401)
语句未结束
/manage.asp, line 73, column 22
currentpage= totalPut MaxPerPage
---------------------^


浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MyIE2)


相关程序如下:
<!--#include file="conn.asp"-->
<%

if request.cookies("adminok")="" then
response.redirect "login.asp"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>ASP技巧专题</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<link rel="stylesheet" type="text/css" href="style.css">
<script language="javascript">
function popwin2(id,path)
{ window.open("openarticle.asp?id="+id+"&ppath="+path,"","height=450,width=600,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
</script>
</head>
<%
const MaxPerPage=18
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
dim sql
dim rs
dim rstype
dim typesql
dim typeid,typename
if not isEmpty(request("typeid")) then
typeid=request("typeid")
else
typeid=1
end if
set rstype=server.createobject("adodb.recordset")
typesql="select * from type where typeID="&cstr(typeid)
rstype.open typesql,conn,1,1
if not rstype.eof then
typename=rstype("type")
end if
rstype.close
set rstype=nothing
%>
<body>
<div align="center"><center>
<table border="0" width="92%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" style="border-left: thin dotted rgb(0,128,0); border-right: thin dotted rgb(0,128,0)"><p align="center"><br>
动网ASP技巧专题&gt;&gt;<font color="#FF0000"><%response.write ""&typename&""%></font><br>
<center>
<a href="manage.asp?typeid=1">ASP教程</a>|<a href="manage.asp?typeid=2">ASP FAQ</a>|<a href="manage.asp?typeid=3">ASP文摘</a>
|<a href="manage.asp?typeid=4">ASP实例</a>|<a href="manage.asp?typeid=5">ASP安全</a>|<a href="changepass.asp" title="用于修改管理员密码名称以及增加修改删除栏目"><font color=red>管理页面</font></a>
<div align="center"><%
sql="select * from article where typeid="+cstr(typeid)+" order by data desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'> 还 没 有 任 何 文 章</p>"
else
totalPut=rs.recordcount
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut MaxPerPage(第73行)
else
currentpage= totalPut MaxPerPage + 1
end if

end if
if currentPage=1 then
showpage totalput,MaxPerPage,"manage.asp"
showContent
showpage totalput,MaxPerPage,"manage.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"manage.asp"
showContent
showpage totalput,MaxPerPage,"manage.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"manage.asp"
showContent
showpage totalput,MaxPerPage,"manage.asp"
end if
end if
rs.close
end if

set rs=nothing
conn.close
set conn=nothing

sub showContent
dim i
i=0

%>

搜索更多相关主题的帖子: compatible 浏览器 Microsoft Windows 
2007-01-13 22:36
yqhxc
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-11-5
得分:0 
这是conn.asp的:
<%
dim conn
dim connstr

'执行子程序
call conn_init()

'连接数据库的子程序
sub conn_init()



'利用server.MapPath来指定数据库的路径,这里的路径是相对路径
connstr="DBQ="+server.mappath("bookid.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"

'利用Connection对象连接数据库
set conn=server.createobject("ADODB.CONNECTION")

'利用open打开连接的数据库
conn.open connstr
end sub
%>
2007-01-13 22:37
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:0 
totalPut楼主程序里的这个是函数还是变量?
2007-01-14 18:24
做人很低调
Rank: 5Rank: 5
等 级:贵宾
威 望:18
帖 子:1268
专家分:0
注 册:2006-8-2
得分:0 

const MaxPerPage=18
totalPut=rs.recordcount


LZ你都写出来了MaxPerPage和totalPut都是变量
我猜想你下边的代码 应该少写了一个运算符"\"
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage(第73行)
else
currentpage= totalPut \ MaxPerPage + 1
end if


其实我很低调,只是你不知道...
2007-01-14 23:23
hangxj
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2045
专家分:0
注 册:2006-4-10
得分:0 
同意楼上的

http://www./
2007-01-15 09:34



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-115855-1-1.html




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

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