📄 scorequery1_2.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="StudentConn.asp" -->
<%
Dim strStudentNum, strName, strGrade, strClass
strSubject=Trim(Request("Subject"))
strStudentNum= Request("StudentNum")
strName=Request("Name")
strGrade=Request("Grade")
strClass=Request("ClassID")
Dim Recordset1__MMColParam
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_StudentConn_STRING
if (strStudentNum <> "") then
Recordset1__MMColParam =strStudentNum
Recordset1.Source = "SELECT * FROM StudentInfo WHERE StudentNum like '%" & Recordset1__MMColParam & "%' ORDER BY StudentNum"
else
if (strName<>"") then
Recordset1__MMColParam =strName
Recordset1.Source = "SELECT * FROM StudentInfo WHERE Name like '%" & Recordset1__MMColParam & "%' ORDER BY StudentNum"
else
if strClass="All" then
Recordset1.Source = "SELECT * FROM StudentInfo WHERE GradeID = '" & strGrade & "' ORDER BY StudentNum"
else
Recordset1__MMColParam = strClass
Recordset1.Source = "SELECT * FROM StudentInfo WHERE ClassID = '" & Recordset1__MMColParam & "' and GradeID = '" & strGrade & "' ORDER BY StudentNum"
end if
end if
end if
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
Dim Recordset1_total
Dim Recordset1_first
Dim Recordset1_last
' set the record count
Recordset1_total = Recordset1.RecordCount
' set the number of rows displayed on this page
If (Recordset1_numRows < 0) Then
Recordset1_numRows = Recordset1_total
Elseif (Recordset1_numRows = 0) Then
Recordset1_numRows = 1
End If
' set the first and last displayed record
Recordset1_first = 1
Recordset1_last = Recordset1_first + Recordset1_numRows - 1
' if we have the correct record count, check the other stats
If (Recordset1_total <> -1) Then
If (Recordset1_first > Recordset1_total) Then
Recordset1_first = Recordset1_total
End If
If (Recordset1_last > Recordset1_total) Then
Recordset1_last = Recordset1_total
End If
If (Recordset1_numRows > Recordset1_total) Then
Recordset1_numRows = Recordset1_total
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (Recordset1_total = -1) Then
' count the total records by iterating through the recordset
Recordset1_total=0
While (Not Recordset1.EOF)
Recordset1_total = Recordset1_total + 1
Recordset1.MoveNext
Wend
' reset the cursor to the beginning
If (Recordset1.CursorType > 0) Then
Recordset1.MoveFirst
Else
Recordset1.Requery
End If
' set the number of rows displayed on this page
If (Recordset1_numRows < 0 Or Recordset1_numRows > Recordset1_total) Then
Recordset1_numRows = Recordset1_total
End If
' set the first and last displayed record
Recordset1_first = 1
Recordset1_last = Recordset1_first + Recordset1_numRows - 1
If (Recordset1_first > Recordset1_total) Then
Recordset1_first = Recordset1_total
End If
If (Recordset1_last > Recordset1_total) Then
Recordset1_last = Recordset1_total
End If
End If
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>员工工资查询</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2600.0" Name=GENERATOR>
<link href="home.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE2 {
font-size: 18px;
color: #0066cc;
}
body {
background-color: #f7f7ff;
}
-->
</style>
</HEAD>
<BODY leftMargin=0 topMargin=0>
<div align="center">
<!--#include file="ScoreManage_Top.asp"-->
<span class="STYLE2"><br>
<br>
按项目方式查询</span><br>
<br>
<br>
<br>
</div>
<TABLE cellSpacing=0 cellPadding=0 width=600 align=center border=1 bordercolor="#CCCCFF" style="border-collapse:collapse">
<TR>
<TD height="30" align="center" valign="middle" bgcolor="#F7f7ff">
<font color="#FF0000">项目名称:</font> <%=strSubject%><font color="#FF0000"><b><font color="#0066cc"> </font></b></font></TD>
<td><font color="#FF0000"><b> 查询条件:</b></font>
<%
if Request("StudentNum")<>"" then
response.write "编号中含有“" & strStudentNum & "”"
elseif strName<>"" then
response.write "姓名中含有“" & strName & "”"
else
if strClass<>"" then response.write strClass
end if
%> <% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
共找到 <font color="#FF0000"><%=(Recordset1_total)%></font> 条记录!</TD></TR>
<tr>
<td colspan="2" align="center"><br>
<table cellspacing=0 border=1 cellpadding="3" bordercolor="#CCCCFF" style="border-collapse:collapse">
<%
dim arrSheetName
dim strSheetName
dim rsSubjects()
dim ArrPass(),ArrExcel(),ArrAttain(),ArrBeyond()
strTemp = Request("chkbox")
arrSheetName = split(strTemp,",")
ReDim ArrPass(UBound(arrSheetName)+1)
Redim ArrExcel(UBound(arrSheetName)+1)
Redim ArrAttain(UBound(arrSheetName)+1)
Redim ArrBeyond(UBound(arrSheetName)+1)
Redim rsSubjects(Ubound(arrSheetName)+1)
For i = LBound(arrSheetName) To UBound(arrSheetName)
strSheetName=trim(cstr(arrSheetName(i)))
Dim rsTestName__MMColParam
rsTestName__MMColParam=strSheetName
set rsTestName = Server.CreateObject("ADODB.Recordset")
rsTestName.ActiveConnection = MM_StudentConn_STRING
rsTestName.Source = "SELECT SheetName, TestName FROM TestName WHERE SheetName = '" + Replace(rsTestName__MMColParam, "'", "''") + "'"
rsTestName.CursorType = 0
rsTestName.CursorLocation = 2
rsTestName.LockType = 3
rsTestName.Open()
rsTestName_numRows = 0
strTestName=rsTestName.Fields.Item("TestName")
ArrPass(i)=0
ArrExcel(i)=0
ArrAttain(i)=0
ArrBeyond(i)=0
next
%>
<tr><td colspan="4" align="center"><%=strTestName%></td></tr>
<tr align="center" valign="middle">
<td width="60"><font color="#000000">编 号</font></td>
<td width="50"><font color="#000000">姓 名</font></td>
<td width="50"><font color="#000000">科 室</font></td>
<%
For i = LBound(arrSheetName) To UBound(arrSheetName)
response.write "<td width='60'><font color='#000000'>" & strSubject & "</font></td>"
next
%>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<%
For i = LBound(arrSheetName) To UBound(arrSheetName)
strSheetName=trim(cstr(arrSheetName(i)))
set rsSubjects(i) = Server.CreateObject("ADODB.Recordset")
rsSubjects(i).ActiveConnection = MM_StudentConn_STRING
rsSubjects__MMColParam =CStr(Recordset1.Fields.Item("StudentNum"))
rsSubjects(i).Source = "SELECT " & strSubject & " FROM " & strSheetName & " WHERE StudentNum = '" + Replace(rsSubjects__MMColParam,"'","''") + "'"
rsSubjects(i).CursorType = 0
rsSubjects(i).CursorLocation = 2
rsSubjects(i).LockType = 3
rsSubjects(i).Open()
next
%>
<tr align="center" valign="middle">
<td height="20" nowrap><%=(Recordset1.Fields.Item("StudentNum").Value)%></td>
<td height="20" nowrap><%=(Recordset1.Fields.Item("Name").Value)%></td>
<td><%=Recordset1.Fields.Item("ClassName").Value%></td>
<%
For i = LBound(arrSheetName) To UBound(arrSheetName)
if rsSubjects(i).bof or rsSubjects(i).eof then
strScore=0
else
strScore=rsSubjects(i).Fields.Item(strSubject).Value
if IsNull(strScore) then strScore=0
end if
If strScore<>"" then
response.write "<td height='20'>" & round(strScore,2) & "</td>"
end if
next
%>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</table>
<% else
Response.Write "<br><br><br>找不到符合条件的记录!<br><br><br>"
end if
%> <br></TD></TR>
</TABLE>
<br>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<Iframe src="CopyRight.asp" width="760" height="100" marginheight="0" marginwidth="0" scrolling="NO" frameborder="0" name="CopyRight"></iframe>
</td>
</tr>
</table></BODY>
</HTML>
<%
Recordset1.Close()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -