0

asp プロジェクトで助けが必要です。

私のページには、テーブルの 1 行だけがページ全体をループしているループがあります。代わりに、1 行だけを表示したいので、2 行目、3 行目、4 行目をロードするボタン/リンクを追加したいと思います。ワードで。

どうすればこれを達成できますか?

これが私のコードです

<%
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>

それは返す

エラーの種類: ADODB.Recordset (0x800A0CB3) 現在の Recordset はブックマークをサポートしていません。これは、プロバイダーまたは選択したカーソルの種類の制限である可能性があります。

4

1 に答える 1