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

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

<html>
<head>
<title>资料查询</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../inc/rz_style.css" type=text/css rel=stylesheet>

<style type="text/css">
<!--
.STYLE8 {font-size: 12px; font-family: "新宋体"; }
.STYLE9 {font-size: 12px}
.STYLE10 {color: #FF9900}
.STYLE11 {color: #FF0000}
-->
</style>
</head>
<body text=#000000 leftmargin=0 topmargin=0 marginheight="0" marginwidth="0" bgcolor="#E5E5E5">

<br>
<table width="787" border="0" align="center" cellpadding="5" cellspacing="1" class="border-all">
<tr>
<td width="846" id="succmsg">当前位置:→<strong>企业资料</strong></td>
</tr>

</table>
<br>
<br>


<table width="764" border="0" align="center" cellpadding="5" cellspacing="1" class="border-all">
<tr>
<th id="succmsg">企业资料查询</th>


</tr>

<%

Set rs= Server.CreateObject("ADODB.Recordset")
sql2="select * from InspectionRequestion1 order by id desc"
rs.open sql2,conn,1,3
%>

<tr align="center" <%response.write ii_body%>>
<td >

<tr>&nbsp;</tr>
<table width="764" border="0" align="center" cellpadding="5" cellspacing="1" class="border-all">
<tr>
<th width="1061" id="succmsg">检查员考核资料</th>

</tr>



<tr align="center" >
<td ><TABLE width="752" height="38%" border=1 cellPadding=5 cellSpacing=0 borderColorLight=#006699 borderColorDark=#ffffff>
<TBODY>
<TR align="left">
<TD height=20 colspan="13" vAlign=middle> </TD>
</TR>
<TR>
<TH width="87" height=20 align="center" vAlign=middle id="succmsg">检查员姓名</TH>
<TH width="56" align="center" vAlign=middle id="succmsg"><span class="STYLE8">性别</span></TH>
<TH width="83" align="center" vAlign=middle id="succmsg"><span class="STYLE8">地 区</span></TH>
<TH width="204" align="center" vAlign=middle id="succmsg"><span class="STYLE8">工作单位</span></TH>

<TH width="75" align="center" vAlign=middle id="succmsg">工作电话<span class="STYLE9"></span></TH>
<TH width="68" align="center" vAlign=middle id="succmsg"><span class="STYLE8">检查企业数</span></TH>

<TH width="91" align="center" vAlign=middle id="succmsg"><span class="STYLE8">操作</span></TH>
</TR>
<%

Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from users order by name desc"
rs.open sql,conn,3,3
if not rs.eof then
count_ii=rs.recordcount
' rs.update
%>
<%
rs.PageSize=2
pagecount=rs.PageCount
page=int(request("page"))
if page<=0 then page=1
if request("page")="" then page=1
rs.AbsolutePage=page
%>

<%
Do while Not Rs.eof
if ii=1 then
ii_body=" bgcolor=#E5E5E5"
ii=0
else
ii_body=" bgcolor=#ffffff"
ii=1
end if

%>
<TD height=20 align="left" vAlign=middle <%response.write ii_body%>>&nbsp;
<a href="GMP_xxzl.asp?<%response.write "disp_na=" & rs("name")%>"><%response.Write rs("name")%>
</a></TD>

<TD align="center" vAlign=middle <%response.write ii_body%>>&nbsp;<%response.Write rs("sex")%></TD>
<TD align="center" vAlign=middle <%response.write ii_body%>>&nbsp;<%response.Write rs("dq")%></TD>
<TD align="center" vAlign=middle <%response.write ii_body%>>&nbsp;<%response.Write rs("dwname")%></TD>
<TD align="center" vAlign=middle <%response.write ii_body%>>&nbsp;<%response.Write rs("dwtel")%></TD>
<TD align="center" vAlign=middle <%response.write ii_body%>>&nbsp;
<% Set rs= Server.CreateObject("ADODB.Recordset")
sql2="select * from checkplan where name=rs("name")'"
rs.open sql2,conn,1,1
if not rs.eof then
%>
<%=rs.recordcount%>

<%
rs.close
end if %>

</TD>

<TD align="center" vAlign=middle <%response.write ii_body%>>&nbsp;[<a href="GMP_jcykh_disp.asp?<%response.write "disp_id=" & rs("SerialNumber")%>&<%response.write "disp_na=" & rs("name")%>" > 查看详细</a>]</TD>
</TR>
<%

Rs.MoveNext
'pass=0
Loop
else
response.Write("系统尚无任何数据!")
rs.close
End If
%>
</TBODY>
</TABLE>
<TABLE width="100%"
height="100%" border=1 align="right" cellPadding=5 cellSpacing=0 borderColorLight=#006699 borderColorDark=#ffffff>
<TBODY>
<TR>
<TD height=20 align="right" vAlign=middle><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20" valign="bottom">

<div align="left">
<% if page=1 and not page=pagecount then %>
第一页|上一页|
<a href="gmp_qyzl.asp?page=<%=page+1%>">下一页|</a>
<a href="gmp_qyzl.asp?page=<%=pagecount%>">最后页|</a>
<% elseif page<>1 and not page=pagecount then %>
<a href="gmp_qyzl.asp?page=1">第一页|</a>
<a href="gmp_qyzl.asp?page=<%=page-1%>">上一页|</a>
<a href="gmp_qyzl.asp?page=<%=page+1%>">下一页|</a>
<a href="gmp_qyzl.asp?page=<%=pagecount%>">最后页|</a>
<% elseif page=pagecount then %>
<a href="gmp_qyzl.asp?page=1">第一页|</a>
<a href="gmp_qyzl.asp?page=<%=page-1%>">上一页|</a>
下一页
最后页
<% END if %>
[
共<%=pagecount%>页][现在第<%=page%> 页] </div></td>
</tr>
</table> </TD>
</TR>
</TBODY>
</TABLE>



</td>
</tr>

</table><table width="768" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>

<td width="203" valign="bottom"> </td>
<td width="47" height="30"></td>
<td width="582" align="right" valign="bottom"> </td>
</tr>
</table>
<br>
<br>

</body>
</html><%set conn=nothing%>
-----------------------------------------------------
问题:我要用上面红色部分数据库的name字段作为条件,在蓝色部分(另一个)库统计name字段值于上面name字段值相同的记录的总数,请问我蓝色部分的where条件怎么写呀????

[此贴子已经被作者于2006-8-31 22:51:31编辑过]

搜索更多相关主题的帖子: asp 查询 
2006-08-31 22:49
快速回复:求asp一个查询问题???我等,急
数据加载中...
 
   



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

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