【asp】好心的程序员啊,帮忙看看代码啊,关键字:翻页,call page,对象关闭时,不允许操作
问题标题含的关键字为了方便网友搜索找到此文章,如果你知道问题出现在什么地方,能帮助解决,我和网友会感谢你的。谢谢阁下问:按照新闻模块的逻辑,图片模块,怎么加入新闻模块中含...
问题标题含的关键字为了方便网友搜索找到此文章,如果你知道问题出现在什么地方,能帮助解决,我和网友会感谢你的。
谢谢阁下
问:
按照新闻模块的逻辑,图片模块,怎么加入新闻模块中含的翻页(page)?
我加了,提示:对象关闭时,不允许操作。
新闻模块
'news page
'参数:lm新闻栏目id,ts条数 ynpage是否分页 0不分 1分 datetype,日期样式 0 不显示
Function news(lm,ts,zs,ynpage,datetype)
'Response.Write " "&VbStr
Dim newstype,newsSql
newstype = saferequest("type",1)
if newstype = "" and lm = 0 then
newsSql = "select * from news order by news_ID desc"
elseif lm <> 0 then
newsSql = "select * from news where news_type = "&lm&" order by news_ID desc"
else
newsSql = "select * from news where news_type = "&newstype&" order by news_ID desc"
end if
'Response.Write newsSql
'Response.End
oRs.PageSize = ts
oRs.CursorLocation = 3
oRs.open newsSql,oConn,1,1
call page1()
if oRs.bof and oRs.eof then
Response.Write "<div class=""titleHint"">本栏目暂未添加文章</div>"
else
for i=1 to oRs.PageSize
if oRs.eof then exit for
Response.Write chr(13)
Response.Write ("<div id=""news"">" & VbStr)
Response.Write ("<div class=""ListTitle"">" & VbStr)
Response.Write ("<div class=""ListTitleA"">" & VbStr)
Response.Write ("·<a href=""/article/show.asp?id="&oRs("news_ID")&""" target=""_blank"">"&GotTopic(oRs("news_Title"),zs)&"</a>" & VbStr)
Response.Write ("</div>" & VbStr)
Response.Write ("<div class=""ListTitleData"">"&Format_Time(oRs("news_Date"),datetype)&" </div>" & VbStr)
Response.Write ("</div>" & VbStr)
Response.Write ("</div>" & VbStr)
IF datetype <> 0 then
end if
oRs.movenext
next
end if
if ynpage=1 then Call Page()
oRs.close
End Function
图片模块
'用于公司荣誉页面
'参数:ts条数,zs字数
Function gsry2(ts,zs,ynpage)
Dim Rs1
set Rs1 = oConn.execute ("select Top "&ts&" * from gsry order by id desc")
do while Not rs1.eof
Response.Write("<div id=""class_AboutG"">" & VbStr)
Response.Write("<div class=""bg"">" & VbStr)
Response.Write("<a href="&rs1("pic")&" title=""点击浏览大图"" target=""_blank""><img src="&rs1("minipic")&" border=""0"" /></a>" & VbStr)
Response.Write("</div>" & VbStr)
Response.Write("<div class=""txt""><a href="&rs1("pic")&" title=""点击浏览大图"" target=""_blank"">"&rs1("name")&"</a></div>" & VbStr)
Response.Write("</div>" & VbStr)
Rs1.movenext
loop
Rs1.Close
End Function
翻页代码
<%
Dim fileName,postion,i
Dim pre,last,intpage,pageNo
Sub Page1()
'-------获取带参数的地址
Dim ScriptAddress,M_ItemUrl,M_item,GetUrl
ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME"))
M_ItemUrl = ""
If (Request.QueryString <> "") Then
ScriptAddress = ScriptAddress & "?"
For Each M_item In Request.QueryString
If M_Item<>"page" then
M_ItemUrl = M_ItemUrl & M_Item &"="& Server.URLEncode(Request.QueryString(""&M_Item&"")) & "&"
End If
Next
end if
... 字节过多,无法发布,代码省略 展开
谢谢阁下
问:
按照新闻模块的逻辑,图片模块,怎么加入新闻模块中含的翻页(page)?
我加了,提示:对象关闭时,不允许操作。
新闻模块
'news page
'参数:lm新闻栏目id,ts条数 ynpage是否分页 0不分 1分 datetype,日期样式 0 不显示
Function news(lm,ts,zs,ynpage,datetype)
'Response.Write " "&VbStr
Dim newstype,newsSql
newstype = saferequest("type",1)
if newstype = "" and lm = 0 then
newsSql = "select * from news order by news_ID desc"
elseif lm <> 0 then
newsSql = "select * from news where news_type = "&lm&" order by news_ID desc"
else
newsSql = "select * from news where news_type = "&newstype&" order by news_ID desc"
end if
'Response.Write newsSql
'Response.End
oRs.PageSize = ts
oRs.CursorLocation = 3
oRs.open newsSql,oConn,1,1
call page1()
if oRs.bof and oRs.eof then
Response.Write "<div class=""titleHint"">本栏目暂未添加文章</div>"
else
for i=1 to oRs.PageSize
if oRs.eof then exit for
Response.Write chr(13)
Response.Write ("<div id=""news"">" & VbStr)
Response.Write ("<div class=""ListTitle"">" & VbStr)
Response.Write ("<div class=""ListTitleA"">" & VbStr)
Response.Write ("·<a href=""/article/show.asp?id="&oRs("news_ID")&""" target=""_blank"">"&GotTopic(oRs("news_Title"),zs)&"</a>" & VbStr)
Response.Write ("</div>" & VbStr)
Response.Write ("<div class=""ListTitleData"">"&Format_Time(oRs("news_Date"),datetype)&" </div>" & VbStr)
Response.Write ("</div>" & VbStr)
Response.Write ("</div>" & VbStr)
IF datetype <> 0 then
end if
oRs.movenext
next
end if
if ynpage=1 then Call Page()
oRs.close
End Function
图片模块
'用于公司荣誉页面
'参数:ts条数,zs字数
Function gsry2(ts,zs,ynpage)
Dim Rs1
set Rs1 = oConn.execute ("select Top "&ts&" * from gsry order by id desc")
do while Not rs1.eof
Response.Write("<div id=""class_AboutG"">" & VbStr)
Response.Write("<div class=""bg"">" & VbStr)
Response.Write("<a href="&rs1("pic")&" title=""点击浏览大图"" target=""_blank""><img src="&rs1("minipic")&" border=""0"" /></a>" & VbStr)
Response.Write("</div>" & VbStr)
Response.Write("<div class=""txt""><a href="&rs1("pic")&" title=""点击浏览大图"" target=""_blank"">"&rs1("name")&"</a></div>" & VbStr)
Response.Write("</div>" & VbStr)
Rs1.movenext
loop
Rs1.Close
End Function
翻页代码
<%
Dim fileName,postion,i
Dim pre,last,intpage,pageNo
Sub Page1()
'-------获取带参数的地址
Dim ScriptAddress,M_ItemUrl,M_item,GetUrl
ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME"))
M_ItemUrl = ""
If (Request.QueryString <> "") Then
ScriptAddress = ScriptAddress & "?"
For Each M_item In Request.QueryString
If M_Item<>"page" then
M_ItemUrl = M_ItemUrl & M_Item &"="& Server.URLEncode(Request.QueryString(""&M_Item&"")) & "&"
End If
Next
end if
... 字节过多,无法发布,代码省略 展开
2个回答
展开全部
代码不全,但就是ORS.CLOSE后还调用了对数据库进行操作的函数,所以提示不允许操作,自己找吧,祝你好运
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询