标题:下面代码怎么改
取消只看楼主
suwei001
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2012-2-29
 问题点数:0 回复次数:0 
下面代码怎么改
<%
    if request("key")<>"" or size<>"" or nn<>"" then
        if key="" then
    sql0="1=1"
    else
    sql0="编号 like '%"&key&"%'"
    end if
    if size="" then
    sql1="1=1"
    else
    sql1="trim(型号)='"&trim(size)&"'"
    end if
    response.write "<p align=center  style='margin-top: 0; margin-bottom: 0'>你查询的传感器编号为:<b>"&key&"</b>"
    if size<>"" then response.write ",型号为<b>"&size&"</b>"
    response.write "<br><br>"
    strSql="Select top "&nn&" * From [sheet1$]  where "&sql0&"  and "&sql1&" order by 编号,型号 "
Set rs=conn.Execute(strSql)

if not rs.bof and not rs.eof then%>
    <table border="0" cellpadding="0" cellspacing="0" width="800" id="table2">
        <tr>
            <td>
            <table border="1" cellpadding="0" width="260" id="table3" style="border-collapse: collapse" bordercolor="#808080">
            
    <%

Do While Not rs.EOF
%>        
            
                <tr>
                    <td height="30" align="center" width="30%"><b>型号</b></td>
                    <td height="30" align="center" width="25%"><%=rs("型号")%></td>
                    <td height="30" align="center" width="20%"><b>编号</b></td>
                    <td height="30" align="center" width="25%"><%=rs("编号")%></td></tr>
                <tr>   
                    <td height="30" align="center" width="30%"><b>X(1)灵敏度</b></td>
                    <td height="30" align="center" width="25%"><%=rs("X灵敏度")%></td>
                     <td height="30" align="center" width="20%"><b>单位</b></td>
                        <td height="30" align="center" width="25%"><%=rs("单位1")%></td></tr>
                    
                <tr>
                    <td height="30" align="center" width="30%"><b>Y(2)灵敏度</b></td>
                    <td height="30" align="center" width="25%"><%=rs("Y灵敏度")%></td>
                    <td height="30" align="center" width="20%"><b>单位</b></td>
                    <td height="30" align="center" width="25%"><%=rs("单位2")%></td></tr>
                <tr>
                    <td height="30" align="center" width="30%"><b>Z(3)灵敏度</b></td>
                    <td height="30" align="center" width="25%"><%=rs("Z灵敏度")%></td>
                    <td height="30" align="center" width="20%"><b>单位</b></td>
                    <td height="30" align="center" width="25%"><%=rs("单位3")%></td>
                </tr>
                <tr>
                    <td height="30" align="center" width="30%"><b>4档灵敏度</b></td>
                    <td height="30" align="center" width="25%"><%=rs("4灵敏度")%></td>
                    <td height="30" align="center" width="20%"><b>单位</b></td>
                    <td height="30" align="center" width="25%"><%=rs("单位4")%></td>
                </tr>
        
               
<%rs.MoveNext
Loop
else
response.write "数据库中没有此产品编号!"
end if
rs.Close
Set rs=nothing
conn.Close
Set conn=Nothing
%>

请问我如果用红色部分代码同时能查SHEET2表格内容该怎么改代码1
搜索更多相关主题的帖子: 型号 传感器 request center style 
2012-02-29 16:52



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-361887-1-1.html




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

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