📄 scorequery3.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="StudentConn.asp" -->
<%
Dim rsTestName__MMColParam,rsScore__MMColParam
Dim strSheetName, strStudentNum, strName, strGrade, strClass,strSubjects
strSheetName = Request("SheetName")
rsTestName__MMColParam = Request("SheetName")
strOrderField=Request("OrderField")
if strOrderField="" then strOrderField="StudentNum"
set rsSubjects = Server.CreateObject("ADODB.Recordset")
rsSubjects.ActiveConnection = MM_StudentConn_STRING
rsSubjects.Source = "SELECT Top 1 * FROM " & strSheetName
rsSubjects.CursorType = 0
rsSubjects.CursorLocation = 2
rsSubjects.LockType = 3
rsSubjects.Open()
rsSubjects_numRows = 0
strSubjects=strSheetName & "." & rsSubjects.Fields.Item(4).Name
for i=5 to rsSubjects.Fields.Count-1
strSubjects = strSubjects & "," & strSheetName & "." & rsSubjects.Fields.Item(i).Name
next
strSubjects = strSubjects & "," & strSheetName & ".应发总数," & strSheetName & ".实发总数," & 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
%>
<%
strStudentNum= Request("StudentNum")
strName=Request("Name")
strClass=Request("ClassID")
set rsScore = Server.CreateObject("ADODB.Recordset")
rsScore.ActiveConnection = MM_StudentConn_STRING
strSQL = "Select " & strSheetName & ".StudentNum, StudentInfo.Name, " & strSubjects & " From " & strSheetName
strSQL = strSQL & " LEFT JOIN StudentInfo ON " & strSheetName & ".StudentNum = StudentInfo.StudentNum"
if (strStudentNum <> "") then
strSQL = strSQL & " Where " & strSheetName & ".StudentNum Like '%" & strStudentNum & "%'"
elseif (strName<>"") then
strSQL = strSQL & " Where StudentInfo.Name Like '%" & strName & "%'"
else
if strClass="All" then strClass=""
strSQL = strSQL & " Where StudentInfo.ClassName Like '%" & strClass & "%'"
end if
strSQL = strSQL & " ORDER BY " & strSheetName & "." & strOrderField
rsScore.Source = strSQL
rsScore.CursorType = 0
rsScore.CursorLocation = 2
rsScore.LockType = 3
rsScore.Open()
rsScore_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rsScore_numRows = rsScore_numRows + Repeat1__numRows
%>
<%
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<%
Dim rsScore_total
Dim rsScore_first
Dim rsScore_last
rsScore_total = rsScore.RecordCount
If (rsScore_numRows < 0) Then
rsScore_numRows = rsScore_total
Elseif (rsScore_numRows = 0) Then
rsScore_numRows = 1
End If
rsScore_first = 1
rsScore_last = rsScore_first + rsScore_numRows - 1
If (rsScore_total <> -1) Then
If (rsScore_first > rsScore_total) Then
rsScore_first = rsScore_total
End If
If (rsScore_last > rsScore_total) Then
rsScore_last = rsScore_total
End If
If (rsScore_numRows > rsScore_total) Then
rsScore_numRows = rsScore_total
End If
End If
%>
<%
If (rsScore_total = -1) Then
rsScore_total=0
While (Not rsScore.EOF)
rsScore_total = rsScore_total + 1
rsScore.MoveNext
Wend
If (rsScore.CursorType > 0) Then
rsScore.MoveFirst
Else
rsScore.Requery
End If
If (rsScore_numRows < 0 Or rsScore_numRows > rsScore_total) Then
rsScore_numRows = rsScore_total
End If
rsScore_first = 1
rsScore_last = rsScore_first + rsScore_numRows - 1
If (rsScore_first > rsScore_total) Then
rsScore_first = rsScore_total
End If
If (rsScore_last > rsScore_total) Then
rsScore_last = rsScore_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">
</HEAD>
<BODY text=#000000 bgColor=#f7f7ff leftMargin=0 topMargin=0>
<!--#include file="ScoreManage_Top.asp"-->
<TABLE cellSpacing=0 cellPadding=0 width=760 align=center border=0>
<TR>
<TD align="center" bgcolor="#F7f7ff"><p align="center"><font size="5"><strong>统计汇总结果</strong></font><br>
<br><span class="msg"><%=Request("nnmsg")%></span>
</p>
<b> 月库名称:</b> <%=(rsTestName.Fields.Item("TestName").Value)%><font color="#FF0000"><b><font color="#0066cc"> </font></b></font><b>查询条件:</b>
<%
if Request("StudentNum")<>"" then
response.write "编号中含有“" & strStudentNum & "”"
elseif strName<>"" then
response.write "姓名中含有“" & strName & "”"
else
if strClass<>"" then response.write strClass
end if
%>
<% If Not rsScore.EOF Or Not rsScore.BOF Then %>
<form Name="del" onSubmit="return ConfirmDel()" method="post" action="ScoreDel2.asp">
共找到 <font color="#FF0000"><%=(rsScore_total)%></font> 条记录!
<table cellspacing=0 width="100%" border=1 cellpadding="0" bordercolor="#FFCC00" style="border-collapse:collapse">
<tr align="center" valign="middle" bordercolor="#FFCC00">
<td height="28"><font color="#000000">编 号</font></td>
<td height="28"><font color="#000000">姓 名</font></td>
<%
for i=2 to rsScore.Fields.Count-1
Response.Write "<td height='28'><font color='#000000'>" & rsScore.Fields.Item(i).Name & "</font></td>"
next
%>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsScore.EOF))
%>
<tr align="center" valign="middle">
<%
for i=0 to rsScore.Fields.Count-1
tmpScore=rsScore.Fields.Item(i).Value
if tmpScore<>"" and i>1 then
tmpScore=Round(tmpScore,2)
end if
if IsNull(tmpScore) then tmpScore=" "
Response.Write "<td height='20'>" & tmpScore & "</td>"
next
%>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsScore.MoveNext()
Wend
%>
</table>
</form>
<br> <br> <br>
找不到符合条件的记录!<br> <br> <br> <% end if %>
</TD>
</TR>
</TABLE>
<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>
<%
rsTestName.Close()
%>
<%
rsScore.Close()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -