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

📄 searchresult.asp

📁 该资料包含大量网络开发的案例和源代码
💻 ASP
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查询结果</title>
<meta name="Microsoft Border" content="b, default">
</head>

<body><!--msnavigation--><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><!--msnavigation--><td valign="top">
<center>
<%
	dim adoConn
    dim adoRS
	dim sConnection
    dim sSQL
    dim t1,A,B,C,A1,B1,C1

  	t1=trim(request.form("t1"))
  	
    set adoConn=server.createobject("ADODB.Connection")
    set adoRS=server.createobject("ADODB.Recordset")
    sConnection="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.mappath("student.mdb")
    adoConn.open sConnection
	
	if request.form("r1")="Student" then
		A="课程号"
		B="课程"
		C="成绩"
		response.write "<h1><font size=4>以下所列的就是您要查询的学生的情况</h1></font><br>"
		sSQL="select c.cno,c.cn ,sc.g,s.sn,s.sd from s,sc,c where s.sno=sc.sno and sc.cno=c.cno and s.sno="& t1 &" order by c.cno"
	elseif request.form("r1")="Class" then
		A="学号"
		B="姓名"
		C="成绩"
		response.write "<h1><font size=4>以下所列的就是您要查询的选修课的学生</h1></font><br>"
		sSQL="select s.sno ,s.sn ,sc.g from s,sc where s.sno=sc.sno and cno="& t1
	end if
	
    set adoRS=adoConn.execute(sSQL)
    
    if adoRS.bof and adoRS.eof then  
		response.write("Sorry!找不到您要查询的信息!")   	'<script language="vbscript">msgbox "找不到你要查询的信息!"</script>
    else
    	if request.form("r1")="Student" then response.write "该学生学号:"& request.form("t1")&"<br>" &"姓名:"& adoRS(3)&"<br>" & "专业:"& adoRS(4)&"<br>"&"<br>"&"以下为选修课情况:"&"<br>"%>	
     
	    <table width="400" border = 1 >
        <tr bgcolor="#666666"> 
        <td><font size="2"><%=A%></font></td>
        <td><font size="2"><%=B%></font></td>
        <td><font size="2"><%=C%></font></td></tr>
	   
		<%do while not adoRS.eof%>
        	<tr bgcolor="#00FFCC">
	    	<td><font size="2"><% =adoRS(0)%></font></td>
	    	<td><font size="2"><% =adoRS(1)%></font></td>
	    	<td><font size="2"><% =adoRS(2)%></font></td></tr>
			<%adoRS.movenext
     	loop     	
	end if
	
    adoRS.close
    adoConn.close
    set adoRS=nothing
    set adoConn=nothing
%>
 </table>
  <p><a href="javascript:history.go(-1);">返回上一页</a></p>
<p><a href="index.asp">返回主页</a></p>
</center>
<!--msnavigation--></td></tr><!--msnavigation--></table><!--msnavigation--><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td>

<p align="center"><font color="#333333" size="2">版权所有|关于我们</font>

</td></tr><!--msnavigation--></table></body>
</html>

⌨️ 快捷键说明

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