| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 271 人关注过本帖
标题:[求助]一个查询的问题
只看楼主 加入收藏
yjmsimple
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-4-19
收藏
 问题点数:0 回复次数:0 
[求助]一个查询的问题

<!--#include file="../conn.asp"-->
<!--#include file="check_user.asp"-->
<html>

<%

dim worker_id, worker_name, score_value, cla_id, time_begin, time_end,power_value,substation_id,page,next_asp_parameter


substation_id=trim(request("substation_id"))
worker_id = trim( request("worker_id") )
worker_name = trim( request("worker_name") )
score_value = trim( request("score_value") )
cla_id = trim( request("cla_id") )
time_begin = trim( request("time_begin") )
time_end = trim( request("time_end" ) )
page = trim(Request("page")) '接受分页参数page,
if not isnumeric(page) then page=1 end if 'page不为数字时的处理
if page="" then page=1 end if 'page为空时的处理
page=cint(page) '转化
if page<1 then page=1 end if 'page为<1时的处理

next_asp_parameter="substation_id=" & substation_id & "cla_id="& cla_id & "&worker_id=" & worker_id & "&power_value=" & power_value & "&worker_name=" & worker_name & "&score_value=" & score_value & "&time_begin=" & time_begin & "&time_end=" & time_end
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title><%=welcome%></title>
<style>
<!--
#iewrap{
position:relative;
height:10px
}

#iewrap2{
position:absolute
}

#dropmenu03{
filter:revealTrans(Duration=1.5,Transition=12)
visibility:hide
}
-->
</style>
<link rel=stylesheet href="../js/style.css" type="text/css">
</head>
<body leftMargin=0 topMargin=0 marginheight="0" marginwidth="0" background="../images/background.gif" onmouseover="self.status='<%=left_welcome%>';return true">
<table border="0" width="100%" height="50" cellspacing="0" cellpadding="0">
<tr>
<td height="50" width="55%" align="right"><div style='font-size:15px;font-weight:bold'><%=showScore_all%></div></td>
<td width="45%" align="right"><a href="page.asp?substation_id=<%=substation_id%>"></a></td>
</tr>
</table>


<%
if not isnumeric(power_value) then power_value=100 end if

if (power_value < 4) then

set rs=Server.CreateObject("ADODB.recordset")

sql_where = " 1=1 "

if substation_id <> "" then
sql_where = sql_where & " and zdbit_worker.worker_substation = '" & substation_id & "'"
end if

if worker_id <> "" then
sql_where = sql_where & " and zdbit_score.s_workerId = '" & worker_id & "'"
end if

if worker_name <> "" then
sql_where = sql_where & " and zdbit_worker.worker_name = '" & worker_name & "'"
end if

if score_value <> "" then
sql_where = sql_where & " and zdbit_score.s_value = '" & score_value & "'"
end if

if score_value <> "" then
sql_where = sql_where & " and zdbit_&cla_id = '" & cla_id & "'"
end if

if time_begin <> "" then
sql_where = sql_where & " and zdbit_score.s_timeEnd >= '" & time_begin & "'"
end if

if time_end <> "" then
sql_where = sql_where & " and zdbit_score.s_timeEnd < '" & time_end & "'"
end if

sql="SELECT zdbit_score.*, zdbit_worker.worker_name AS
worker_name,zdbit_substation.s_name AS
substation_name,zdbit_setup.setup_translate AS
score_value_name
FROM zdbit_score INNER JOIN zdbit_worker ON zdbit_score.s_workerId = zdbit_worker.worker_id INNER JOIN zdbit_setup ON zdbit_setup.setup_score = zdbit_score.s_value INNER JOIN zdbit_substation ON zdbit_worker.worker_substation = zdbit_substation.s_id WHERE " & sql_where & " ORDER BY zdbit_score.s_timeEnd DESC"

'Response.Write "<br>" & sql

rs.OPEN sql,conn,1,1
rCount = rs.RecordCount
rs.Pagesize=10
%>
<table border="0" width="100%" height="20" cellspacing="0" cellpadding="0">
<tr>
<td height="20" align="center"><%=Lfind%><font color="red"><%=rCount%></font><%=showScore_notes%></td>
</tr>
<tr>
<td height="20" align="center"><hr color=red size=1></td>
</tr>
</table>
<table border="0" width="100%" height="25" cellspacing="0" cellpadding="2">
<%if rCount<>0 then%>
<tr>
<td align=right>

<a href="searcheasy.asp" target="_self"><img src="../images/adduser.gif" alt="查询" width="25" height="25" border="0"></a><a href="../loading.asp?<%=next_asp_parameter%>&act=xls"
target=_blank onclick="window.open(this.href,'','width=500,height=500,resizable=yes,scrollbars=yes,titlebar=no,toolbar=no,status=no,top=80,left=260');return false"> </a> &nbsp;&nbsp;&nbsp;&nbsp;<a href="../loading.asp?<%=next_asp_parameter%>&act=xls"
target=_blank onclick="window.open(this.href,'','width=500,height=500,resizable=yes,scrollbars=yes,titlebar=no,toolbar=no,status=no,top=80,left=260');return false"><img name="excel" src="/images/excel.gif"
onmousedown="document.images['excel'].src='/images/excel2.gif'"
onmouseout="document.images['excel'].src='/images/excel.gif'"
onmouseover="document.images['excel'].title='<%=showScore_excel%>'"
onmouseup="document.images['excel'].src='/images/excel.gif'"
width=25 height=25 border=0 >

</a>

&nbsp;&nbsp;&nbsp;&nbsp;

<a href="../loading.asp?<%=next_asp_parameter%>&act=print"
target=_blank onclick="window.open(this.href,'','width=500,height=500,resizable=yes,scrollbars=yes,titlebar=no,toolbar=no,status=no,top=80,left=260');return false"><img name="print" src="/images/Printer.gif"
onmousedown="document.images['print'].src='/images/Printer2.gif'"
onmouseout="document.images['print'].src='/images/Printer.gif'"
onmouseover="document.images['print'].title='<%=showScore_print%>'"
onmouseup="document.images['print'].src='/images/Printer.gif'"
width=25 height=25 border=0 ></a>
&nbsp;&nbsp;&nbsp;&nbsp;

</td>

</tr>
<%end if%>
</table>
<table border="0" width="100%" height="25" cellspacing="0" cellpadding="2">
<tr>
<td height="25" width="12%" align="center"><font color="red"><%=Luser%></font></td>
<td height="25" width="12%" align="center"><font color="red"><%=Lname%></font></td>
<td height="25" width="12%" align="center"><font color="red"><%=Ldept%></font></td>
<td height="25" width="12%" align="center"><font color="red"><%=Lvalue%></font></td>
<td height="25" width="12%" align="center"><font color="red"><%=Lwindow%></font></td>
<td height="25" width="16%" align="center"><font color="red"><%=Ltime%></font></td>

<% if int(power_value) = 1 then %>
<td height="25" width="12%" align="center"><font color="red"><%=Ledit%></font></td>
<td height="25" width="12%" align="center"><font color="red"><%=Ldel%></font></td>
<% end if%>

</tr>
<br>
<tr>
<%if not rs.EOF then

if page>rs.PageCount then page=rs.PageCount end if 'page为>总分页数的处理

rs.AbsolutePage=page

i=0
do while not rs.eof
i=i+1
if i="11" then exit do
%>

<td height="12" align="center"><%=rs.Fields("s_workerId")%> </td>
<td height="12" align="center"><%=rs.Fields("worker_name")%> </td>
<td height="12" align="center"><%=rs.Fields("substation_name")%> </td>
<td height="12" align="center"><%=rs.Fields("score_value_name")%> </td>
<td height="12" align="center"><%=rs.Fields("s_windowName")%> </td>
<td height="12" align="center"><%=rs.Fields("s_timeEnd")%> </td>

<%if int(power_value) =1 then %>
<td height="12" align="center"><a href="editscore.asp?<%=next_asp_parameter%>&scoreid=<%=rs("index")%>"><img border="0" src="<%=showScore_edit_gif%>" width="50" height="15" align=absmiddle></a></td>
<td height="12" align="center"><a href=javascript:if(confirm("<%=showScore_recom%>"))location="delscore.asp?<%=next_asp_parameter%>&scoreid=<%=rs("index")%>"><img border="0" src="<%=showScore_del_gif%>" width="50" height="15" align=absmiddle></a></td>
<%end if%>

</tr>

<%
rs.movenext
loop
%>
</table>

<br><br>
<%if score_value="" then%>
<table border="0" width="90%" cellspacing="0" cellpadding="0">
<tr>
<% if rCount<>0 then %>
<td align="right"><img src="/images/jump.gif">
<a href="../showgraph.asp?<%=next_asp_parameter%>"><font color=#ff0000><%=showScore_graph%></font></a>
</td>
<%end if%>
</tr>
<table>
<%end if%>

<br><br>


<table border="0" width="100%" cellspacing="0" cellpadding="0">

<form name="form1" method="post" action="showScore.asp?<%=next_asp_parameter%>">
<tr>
<td align="center">
<p align="center"><%=Ltotal%><font color=#000000> <%=rs.RecordCount%> </font><%=Lamount%>&nbsp;|&nbsp;<%=showScore_dispart%><font color=#000000> <%=rs.PageCount%> </font><%=showScore_page%>&nbsp;|&nbsp;<%=showScore_no%><font color=#000000> <%=page%> </font><%=showScore_page%>&nbsp;|&nbsp;

<a href=showScore.asp?<%=next_asp_parameter%>&page=<%=page-1%>><%=showScore_previous%></a>&nbsp;|&nbsp;
<a href=showScore.asp?<%=next_asp_parameter%>&page=<%=page+1%>><%=showScore_next%></a>&nbsp;|&nbsp;

<a href=showScore.asp?<%=next_asp_parameter%>&page=1><%=showScore_first%></a>&nbsp;|&nbsp;
<a href=showScore.asp?<%=next_asp_parameter%>&page=<%=rs.PageCount%>><%=showScore_last%></a><p align="center"> </td>
</tr>
<tr>
<td align="center">

<p align="right">

<%=showScore_number%><%=showScore_no%>
<input type="text" name="page" maxlength=3 style="width:20;background-color:rgb();">
<%=showScore_page%>
<input type="submit" name="Submit1" value="go" style="width:30">
</td>
</tr>
</form>

</table>

<%end if%>

<%If rCount = 0 Then %>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr><td><br><br><br><br></td></tr>
<tr><td align="center"><font color=red><%=Lnorecords%></font></td></tr>
</table>
<%end if%>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>

<%end if%>

<%if power_value > 3 then%>
<script language='javascript'>window.alert('<%=Lerror%>');</script>
<script language='javascript'>parent.window.history.go(-1);</script>
<%end if%>


错误类型:
Microsoft VBScript 编译器错误 (0x800A0409)
未结束的字符串常量
/wwwroot/admin/showScore.asp, line 95, column 54
sql="SELECT zdbit_score.*, zdbit_worker.worker_name AS
-----------------------------------------------------^

搜索更多相关主题的帖子: 查询 
2007-04-19 09:07
快速回复:[求助]一个查询的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.049436 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved