一个简单的查询 貌似缺点什么 实现不了
程序代码:
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 编辑 ]