| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 499 人关注过本帖
标题:一个简单的查询 貌似缺点什么 实现不了
只看楼主 加入收藏
kevinxu0638
Rank: 2
来 自:江苏
等 级:论坛游民
帖 子:147
专家分:62
注 册:2009-10-19
结帖率:100%
收藏
 问题点数:0 回复次数:2 
一个简单的查询 貌似缺点什么 实现不了
程序代码:
select.asp
------------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<form action="show.asp" method="post" name="form1" target="_blank" id="form1">
  <table width="68%" height="28" border="1" align="center">
    <tr>
      <td width="10%" height="10"><div align="center">业务类别:</div></td>
      <td width="11%" height="10">        <label>
        <div align="left">
          <select name="ywlb" id="ywlb">
            <option>公路转关</option>
            <option>一日游</option>
            <option>监管业务</option>
          </select>
        </div>
        </label>      </td>
      <td height="10"><div align="center">货 代:</div></td>
      <td height="10"><label>
          <div align="left">
            <select name="hd" id="hd">
              <option>华星</option>
              <option>外代</option>
              <option>中外运</option>
              <option>宏达</option>
              <option>天顺</option>
              <option>欣海</option>
            </select>
          </div>
        </label>      </td>
      <td width="17%" height="10"><div align="center">提单号/品名:</div></td>
      <td width="15%" height="10">        <label>
        <div align="left">
          <input name="thd" type="text" id="thd" size="25" />
        </div>
        </label>      </td>
    </tr>
    <tr>
      <td height="10" colspan="3"><div align="center">
        <label>
        <input type="submit" name="Submit" value="查询" />
        </label>
      </div>        <div align="center"></div>        <div align="center"></div></td>
      <td height="10" colspan="3"><div align="center">
        <label>
        <input type="reset" name="Submit2" value="重置" />
        </label>
      </div>        <div align="center"></div>        <div align="center"></div></td>
    </tr>
  </table>
</form>
</body>
</html>

show.asp
--------------------------------------
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/table.asp" -->
<%
Dim xy
Dim xy_numRows
Dim D,Y,H

D=request.form("tdh")
Y=request.form("ywlb")
H=request.form("hd")
Set xy = Server.CreateObject("ADODB.Recordset")
xy.ActiveConnection = MM_table_STRING
xy.Source = "SELECT *  FROM 2011  WHERE ywlb ='"&Y&"' AND tdh ='"&D&"'AND hd='"&H&"'  ORDER BY lsbh"
xy.CursorType = 0
xy.CursorLocation = 2
xy.LockType = 1
xy.Open()

xy_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = 10
Repeat1__index = 0
xy_numRows = xy_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.>
<html xmlns="http://www.>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<form action="" name="form2" target="_self" id="form2">
  <table width="78%" border="1" align="center">
    <tr>
      <td width="9%">流水编号</td>
      <td width="10%">出/入</td>
      <td width="8%">日期</td>
      <td width="9%">业务类别</td>
      <td width="8%">批号/品名</td>
      <td width="7%">货代</td>
      <td width="7%">重量</td>
      <td width="7%">体积</td>
      <td width="9%">入库数量</td>
      <td width="9%">出口数量</td>
      <td width="9%">运输车号</td>
      <td width="8%">备注</td>
    </tr>
    <%
While ((Repeat1__numRows <> 0) AND (NOT xy.EOF))
%>
      <tr>
        <td><%=(xy.Fields.Item("lsbh").Value)%></td>
        <td><%=(xy.Fields.Item("cr").Value)%></td>
        <td><%=(xy.Fields.Item("time").Value)%></td>
        <td><%=(xy.Fields.Item("ywlb").Value)%></td>
        <td><%=(xy.Fields.Item("tdh").Value)%></td>
        <td><%=(xy.Fields.Item("hd").Value)%></td>
        <td><%=(xy.Fields.Item("zl").Value)%></td>
        <td><%=(xy.Fields.Item("tj").Value)%></td>
        <td><%=(xy.Fields.Item("rksl").Value)%></td>
        <td><%=(xy.Fields.Item("cksl").Value)%></td>
        <td><%=(xy.Fields.Item("ysch").Value)%></td>
        <td><%=(xy.Fields.Item("bz").Value)%></td>
      </tr>
      <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  xy.MoveNext()
Wend
%>
  </table>
</form>
</body>
</html>
<%
xy.Close()
Set xy = Nothing
%>
我有2个页面一个是表单页一个是显示查询结果的  现在2个页面都不报错 但是我在表单里输入条件后 查询没结果 麻烦指点下 我哪儿少什么了


[ 本帖最后由 kevinxu0638 于 2011-12-6 09:48 编辑 ]
搜索更多相关主题的帖子: 查询 
2011-12-06 09:46
cwxlryf520
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2009-2-4
收藏
得分:0 
你用的什么编辑器?
2011-12-06 19:17
kevinxu0638
Rank: 2
来 自:江苏
等 级:论坛游民
帖 子:147
专家分:62
注 册:2009-10-19
收藏
得分:0 
回复 2楼 cwxlryf520
我的这个2个页面都没大问题 问题在select.asp中的form里的tdh写成thd了 改了就好了 晕啊 还想了半天我错哪儿了
我用的DW

javascript、asp学习研究中 希望高手多多指教
2011-12-06 21:31
快速回复:一个简单的查询 貌似缺点什么 实现不了
数据加载中...
 
   



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

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