Ms access 使用ASP Classic从access数据库一次显示一行
我的asp项目需要帮助 在我的页面中有一个循环,表中只有一行在整个页面中循环,相反,我只想显示一行,然后我想添加一个按钮/链接,加载第二行、第三行、第四行等 我怎样才能做到这一点 这是我的密码Ms access 使用ASP Classic从access数据库一次显示一行,ms-access,asp-classic,Ms Access,Asp Classic,我的asp项目需要帮助 在我的页面中有一个循环,表中只有一行在整个页面中循环,相反,我只想显示一行,然后我想添加一个按钮/链接,加载第二行、第三行、第四行等 我怎样才能做到这一点 这是我的密码 <% if session("usr")="" then response.Redirect("authentication.asp") end if Set Rs=con.execute("select * from Std_Profile where uid=" & session("
<%
if session("usr")="" then
response.Redirect("authentication.asp")
end if
Set Rs=con.execute("select * from Std_Profile where uid=" & session("usr") & "")
Dim ccode
ccode=Rs("Class_Code")
Set RSlecture=con.execute("select * from eva_lecture where Class_Code='"& ccode &"' ")
Set RSques=con.execute("select * from eva_ques ")
Dim PageLen,PageNo,TotalRecord,TotalPage,No,intID
PageLen = 1
PageNo = Request.QueryString("Page")
if PageNo = "" Then PageNo = 1
TotalRecord = RSlecture.RecordCount
RSlecture.PageSize = PageLen
TotalPage = RSlecture.PageCount
RSlecture.AbsolutePage = PageNo
%>
<div class="activity">
<%
No=1
Do While Not RSlecture.EOF and No <= PageLen
%>
<h3><strong>Q#<% Response.Write(RSques("ques_no"))%> : <% Response.Write(RSques("ques"))%></strong></h3>
<br />
<table width="837" border="1" align="center" cellpadding="0" cellspacing="0">
<tr align="center">
<td width="79" bgcolor="#6699CC"><strong>Subject</strong></td>
<td width="74" bgcolor="#6699CC"><strong>Teacher</strong></td>
<td width="120" bgcolor="#6699CC"><strong>Option #1</strong></td>
<td width="120" bgcolor="#6699CC"><strong>Option #2</strong></td>
<td width="120" bgcolor="#6699CC"><strong>Option #3</strong></td>
<td width="120" bgcolor="#6699CC"><strong>Option #4</strong></td>
</tr>
</table>
<% 'While Not RSlecture.EOF %>
<table width="837" border="1" align="center" cellpadding="0" cellspacing="0">
<tr align="center">
<td width="79"><% Response.Write(RSlecture("subject"))%></td>
<td width="74"><% Response.Write(RSlecture("teacher"))%></td>
<td width="120"><% Response.Write(RSques("opt1"))%></td>
<td width="120"><% Response.Write(RSques("opt2"))%></td>
<td width="120"><% Response.Write(RSques("opt3"))%></td>
<td width="120"><% Response.Write(RSques("opt4"))%></td>
</tr>
</table>
<%
No = No + 1
RSlecture.MoveNext
Loop
%>
Total : <%=TotalRecord%> Records. Page <%=PageNo%> (All Page <%=TotalPage%>)
<% IF Cint(PageNo) > 1 then %>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Page=1"><< First</a>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=PageNo-1%>">< Back</a>
<% End IF%>
<% IF Cint(PageNo) < TotalPage Then %>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=PageNo+1%>">Next ></a>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=TotalPage%>">Last >></a>
<% End IF%>
<br>
Go to
<% For intID = 1 To TotalPage%>
<% if intID = Cint(PageNo) Then%>
<b><%=intID%></b>
<%Else%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=intID%>"><%=intID%></a>
<%End IF%>
<%Next%>
<div>
你的命令顺序不对。试试这个:
Set RSques=con.execute(“从eva_ques中选择*)
Dim PageLen,PageNo,TotalRecord,TotalPage,No,intID
PageLen=1
PageNo=请求.查询字符串(“页面”)
如果PageNo=”“,则PageNo=1
Set rsteaching=Server.CreateObject(“ADODB.Recordset”)
rstouch.CursorLocation=3'成人客户端
rsteache.Open“从eva_讲座中选择*,其中Class_Code=”&ccode&“”,con
rstouch.PageSize=PageLen
rstouch.AbsolutePage=页码
TotalRecord=rstouch.RecordCount
TotalPage=rstouch.PageCount
查看名为记录集分页的术语。你自己试试看。如果您仍然无法使用您尝试的内容编辑您的帖子,我们将尝试引导您完成。谢谢,让我试试…@ShadowWizard我尝试了分页功能,但它返回了一个CursorType错误:(什么功能?如我所说,将您的努力发布为问题的编辑。很抱歉,我忘记更新我的问题。请现在检查。干杯,很高兴我能提供帮助!如果您不介意查看此问题,请问:太好了