请大家帮我看一下代码,修改一下,在线等!!!!

golive 2004-04-07 10:16:58
<%
page_c=10 '显示行数

Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("../Result.mdb")
sql = "select wellposid,yearno,jh,jhdm,jb,ktxm,ktlb,jkddh from surveywellpos where surveyareaid=" & request("id")
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn,3
rs.PageSize=page_c
name="当前位置:"& request("name")&" "&"探区"
Page = CLng(Request("Page")) ' CLng 不可省略
If Page < 1 Then Page = 1
If Page > rs.PageCount Then Page = rs.PageCount
totalcount = rs.recordcount
%>


原因是我点击下一页时'surveyareaid='没有存住。请大家帮我id设为全局变量存起来,然后在surveyareaid=调用它。请大家帮我改一下,谢谢。
...全文
36 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
golive 2004-04-07
  • 打赏
  • 举报
回复
拜托,我是个菜鸟,您这样说我不太清楚。哪位能帮我搞定代码吗??谢谢啊
  • 打赏
  • 举报
回复
你可以连接某个页面的时候指定id的值,然后request.querystring("id")
golive 2004-04-07
  • 打赏
  • 举报
回复
session("id") = request("id")

上面变量,在sql = "select wellposid,yearno,jh,jhdm,jb,ktxm,ktlb,jkddh from surveywellpos where surveyareaid=" & request("id")怎么调用??
zl13 2004-04-07
  • 打赏
  • 举报
回复
session("id") = request("id")
golive 2004-04-07
  • 打赏
  • 举报
回复
上面的朋友我照着你们说的做了,不对啊。定义session("id")存储id怎么写啊??
GoodyeahApple 2004-04-07
  • 打赏
  • 举报
回复
定义session("id")存储id
yinxiong2002 2004-04-07
  • 打赏
  • 举报
回复
在你的数据库中,看一下surveyareaid这个字段的类型是数字型的,还是文本型的

如果是数字型,应为:sql = "select wellposid,yearno,jh,jhdm,jb,ktxm,ktlb,jkddh from surveywellpos where surveyareaid=" & request("id")

如果是文本型,应为:sql = "select wellposid,yearno,jh,jhdm,jb,ktxm,ktlb,jkddh from surveywellpos where surveyareaid='" & request("id")&"'"


zl13 2004-04-07
  • 打赏
  • 举报
回复
每个后面都要加上这个"&id=" & request("id")
&
zl13 2004-04-07
  • 打赏
  • 举报
回复
<%

response.write "共 " & rs.PageCount & " 页 第 " & Page & " 页 "
if Page=1 or rs.PageCount<=1 then
response.write "<font color=gray>首页 前页</font>"
else
response.write "<a href=cjxm_check.asp?page=1>首页</a> <a href=cjxm_check.asp?page=" & Page-1 & ">前页</a>"
end if

if Page=rs.PageCount or rs.PageCount<=1 then
response.write " <font color=gray>后页 尾页</font>"
else
response.write " <a href=cjxm_check.asp?page=" & Page+1 & "&id=" & request("id")
& "">后页</a> <a href=cjxm_check.asp?page=" & rs.PageCount & ">尾页</a>"
end if
%>


response.write " <a href=cjxm_check.asp?page=" & Page+1 & "&id=" & request("id")
&
golive 2004-04-07
  • 打赏
  • 举报
回复
我的后面是这样的代码,怎么修改啊?
<%

response.write "共 " & rs.PageCount & " 页 第 " & Page & " 页 "
if Page=1 or rs.PageCount<=1 then
response.write "<font color=gray>首页 前页</font>"
else
response.write "<a href=cjxm_check.asp?page=1>首页</a> <a href=cjxm_check.asp?page=" & Page-1 & ">前页</a>"
end if

if Page=rs.PageCount or rs.PageCount<=1 then
response.write " <font color=gray>后页 尾页</font>"
else
response.write " <a href=cjxm_check.asp?page=" & Page+1 & ">后页</a> <a href=cjxm_check.asp?page=" & rs.PageCount & ">尾页</a>"
end if
%>

谢谢。
miller530 2004-04-07
  • 打赏
  • 举报
回复
在分页链接下加一个 &id=<%=request("id") %>
如:<a href="<%=Request.ServerVariables("script_name") & "?page=1&id=" & Request("id") %>首页</a>
chinaworker 2004-04-07
  • 打赏
  • 举报
回复
dim id

id =request("id")
zl13 2004-04-07
  • 打赏
  • 举报
回复
id不能设为全局变量,会不可更改的,把surveyareaid和page一起传过去

28,391

社区成员

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

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