⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 questionqueryo.asp

📁 本系统用来开发网络开发系统的实现
💻 ASP
字号:
<!--#include file="adovbs.inc" -->
<!--#include file="admin_conn.asp"-->

<HTML>
<head>
<link  href=../css.css rel=stylesheet type=text/css>
</head>
<BODY>
<P align="center"><STRONG><FONT face="华文彩云" color=darkred  size=6>试题查询</FONT></STRONG></P>

<%

if session("QuestionID")="" and  session("choose")="" and session("letter")=""then
	sql1="select * from test_questions_store"
end if 
if session("QuestionID")<>"" and  session("choose")<>"" and session("letter")="" then
	sql1=sql1 + "where 课程编号=" + session("QuestionID") + "and 正确答案 like [1]"
		
end if
	const N=3
	set myrs1=server.CreateObject("adodb.recordset")
	set rs1=server.CreateObject("adodb.recordset")
	rs1.PageSize=N
	rs1.Open sql1,conn,adOpenStatic
	
	pageth=Request.QueryString("pageth")
	'判断页数是否为空
	if pageth="" then pageth="1"
	'判断页数是否为数字
	if not IsNumeric(pageth) then pageth="1"
	'判断数字是否大于总页数
	pageth=cint(pageth)
	if pageth>rs1.PageCount then pageth=rs1.PageCount 
	
	rs1.AbsolutePage=pageth
%>

<table align=center border=1 cellpadding=0 cellspacing=0 >

<tr><td colspan="11">共有 <%=rs1.RecordCount%> 条记录,每页 <%=N%> 条,共 <%=rs1.PageCount%> 页,当前是第 <%=rs1.AbsolutePage%> 页 </td></tr>
<tr align=center>
	<td>试题编号</td>
	<td>试题内容</td>
	<td>试题答案A</td>
	<td>试题答案B</td>
	<td>试题答案C</td>
	<td>试题答案D</td>
	<td>正确答案</td>
	<td>试题详解</td>
	<td>课程名称</td>
	<td width=30 align=center> 修改 </td>
	<td width=30 align=center> 删除 </td>
	
</tr>
<%	
	for i=1 to N
%>
		<tr align=center>
		<td><%=Server.HTMLEncode(rs1(0))%></td>
		<td><%=Server.HTMLEncode(rs1(1))%></td>
		<td><%=Server.HTMLEncode(rs1(2))%></td>
		<td><%=Server.HTMLEncode(rs1(3))%></td>
		<td><%=Server.HTMLEncode(rs1(4))%></td>
		<td><%=server.HTMLEncode(rs1(5))%></td>
		<td><%=Server.HTMLEncode(rs1(6))%></td>
		<td><%=Server.HTMLEncode(rs1(7))%></td>
		<%
			myrs1.Open "select 课程名称 from course where 课程编号=" & rs1(8).Value & "",conn,adOpenStatic

		%>
		<td><% =myrs1(0) %></td>
		<td><a  href=QuestionQuery.asp?Qm=<% =rs1(0) %> >修改</a></td>
		<td><a  href=QuestionQuery.asp?Qd=<% =rs1(0) %> >删除</a></td>	
</tr>
<%		
		rs1.MoveNext 
		if rs1.EOF then exit for  '避免存在半页时循环出现问题;
		myrs1.close
	next	
	pagepre=pageth-1
	pagenext=pageth+1
	if pagepre<1 then pagepre=1
	if pagenext>rs1.PageCount then pagenext=rs1.PageCount 
%>
<tr>
<td colspan=11>
<form action="QuestionQuery.asp" method="get" id=form1 name=form1>
<%
'如果当前页不是第一页,则显示;
if pageth<>1 then
%>
<a href="QuestionQuery.asp?pageth=1">第一页</a> | 
<a href="QuestionQuery.asp?pageth=<%=pagepre%>">上一页</a> | 
<%
end if
'如果当前页不是最后一页,则显示;
if pageth<>rs1.PageCount then
%>
<a href="QuestionQuery.asp?pageth=<%=pagenext%>">下一页</a>
<a href="QuestionQuery.asp?pageth=<%=rs1.PageCount%>">最后一页</a> | 
<%
	end if
%>
转向第<input name="pageth"  size=2>页
	<input type="submit" value=" GO " id=submit1 name=submit1>
</form>
<%
	rs1.Close
%>
</td>
</tr>
</table>
<%
dim Qdel1,sqlstring			'87
	Qdel1=Request.QueryString("Qd")
	if Qdel1>0 then
		sqlstring="delete from test_questions_store where id =" & Qdel1 & ""
		conn.Execute(sqlstring)
		%>
		<script  language="javascript">
		<!--
			window.alert("已成功删除。");
		-->
		</script>			
		<%		
	end if
session("questionsID")=Request.QueryString("Qm")
if Request.QueryString("Qm") > 0 then
	Response.Redirect("Qmodify.asp")
end if 

%>

<%
	conn.Close
%>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -