首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > vbScript >

选择了一级下拉列表框可以正常使用,到了二级到三级下拉列表框就出有关问题了

2012-03-17 
选择了一级下拉列表框可以正常使用,到了二级到三级下拉列表框就出问题了VBScript code%@LANGUAGEVBSCRI

选择了一级下拉列表框可以正常使用,到了二级到三级下拉列表框就出问题了

VBScript code
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!--#include file="Connections/conn.asp" --><%Dim Recordset1__MMColParamRecordset1__MMColParam = ""If (Request.Form("select1") <> "") Then  Recordset1__MMColParam = Request.Form("select1")end ifDim Recordset2__MMColParamRecordset2__MMColParam = ""If (Request.Form("select2") <> "") Then  Recordset2__MMColParam = Request.Form("select2")end ifDim Recordset3__MMColParamRecordset3__MMColParam = ""If (Request.Form("select3") <> "") Then  Recordset3__MMColParam = Request.Form("select3")end ifDim Recordset1Dim strSqlDim Recordset1_numRowsSet Recordset1 = Server.CreateObject("ADODB.Recordset")Recordset1.ActiveConnection = MM_conn_STRINGstrSql="SELECT * FROM 通关手册 "If Recordset1__MMColParam<>""then    strSql=strSql & " WHERE 手册编号 = '" & Recordset1__MMColParam & "'"end ifRecordset1.source=strSqlRecordset1.CursorType = 0Recordset1.CursorLocation = 2Recordset1.LockType = 1Recordset1.Open()Recordset1_numRows = 0%><%Dim Recordset2Dim Recordset2_numRowsSet Recordset2 = Server.CreateObject("ADODB.Recordset")Recordset2.ActiveConnection = MM_conn_STRINGstrSql="SELECT *FROM 出口成品 "If Recordset1__MMColParam<>""then     strSql=strSql & " WHERE 手册编号 = '" & Recordset1__MMColParam & "'"end ifIf Recordset2__MMColParam<>""then     strSql=strSql & " WHERE 商品名称 = '" & Recordset2__MMColParam & "'"end ifstrSql=strSql & " ORDER BY 成品ID ASC"Recordset2.source=strSqlRecordset2.CursorType = 0Recordset2.CursorLocation = 2Recordset2.LockType = 1Recordset2.Open()Recordset2_numRows = 0%><%Dim Recordset3Dim Recordset3_numRowsSet Recordset3 = Server.CreateObject("ADODB.Recordset")Recordset3.ActiveConnection = MM_conn_STRINGstrSql="SELECT *FROM 出口制成品及对应进口料件消耗备案清单 "If Recordset1__MMColParam<>""then     strSql=strSql & " WHERE 手册编号 = '" & Recordset1__MMColParam & "'"end ifIf Recordset3__MMColParam<>""then     strSql=strSql & " WHERE 成品ID = '" & Recordset3__MMColParam & "'"end ifstrSql=strSql & " ORDER BY 成品ID ASC"Recordset3.source=strSqlRecordset3.CursorType = 0Recordset3.CursorLocation = 2Recordset3.LockType = 1Recordset3.Open()Recordset3_numRows = 0%><%Dim Repeat1__numRowsDim Repeat1__indexRepeat1__numRows = -1Repeat1__index = 0Recordset2_numRows = Recordset2_numRows + Repeat1__numRows%><%Dim Repeat2__numRowsDim Repeat2__indexRepeat2__numRows = -1Repeat2__index = 0Recordset3_numRows = Recordset3_numRows + Repeat2__numRows%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><style type="text/css"><!--.STYLE5 {font-size: 14px}.STYLE7 {    font-size: 18px;    font-family: "楷体_GB2312";}.STYLE8 {font-size: 15px; }--></style></head><body><table width="900" height="50" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#99CCFF">  <tr>    <td><div align="center" class="STYLE5">手册编号</div></td>    <td><div align="center" class="STYLE5"><%=(Recordset1.Fields.Item("手册编号").Value)%></div></td>    <td><div align="center" class="STYLE5">申报日期</div></td>    <td><div align="center" class="STYLE5"><%=(Recordset1.Fields.Item("申报日期").Value)%></div></td>    <td><div align="center" class="STYLE5">有效日期</div></td>    <td><div align="center" class="STYLE5"><%=(Recordset1.Fields.Item("有效日期").Value)%></div></td>  </tr>  <tr>    <td><div align="center" class="STYLE5">企业内部编号</div></td>    <td><div align="center" class="STYLE5"><%=(Recordset1.Fields.Item("企业内部编号").Value)%></div></td>    <td><div align="center" class="STYLE5">经营单位</div></td>    <td><div align="center" class="STYLE5"><%=(Recordset1.Fields.Item("经营单位").Value)%></div></td>    <td><div align="center" class="STYLE5">加工单位</div></td>    <td><div align="center" class="STYLE5"><%=(Recordset1.Fields.Item("加工单位").Value)%></div></td>  </tr></table><br /><span class="STYLE7">出口成品</span><table width="900" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#99CCFF">  <tr>    <td width="55"><div align="center" class="STYLE5">成品ID</div></td>    <td width="75"><div align="center" class="STYLE5">商品编码</div></td>    <td width="75"><div align="center" class="STYLE5">附加编码</div></td>    <td width="285"><div align="center" class="STYLE5">商品名称</div></td>    <td width="80"><div align="center" class="STYLE5">计量单位</div></td>    <td width="100"><div align="center" class="STYLE5">法定计量单位</div></td>    <td width="90"><div align="center" class="STYLE5">申报数量</div></td>    <td width="90"><div align="center" class="STYLE5">申报单价</div></td>  </tr></table><% While ((Repeat1__numRows <> 0) AND (NOT Recordset2.EOF)) %>  <table width="900" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#99CCFF">    <tr>      <td width="55"><div align="center" class="STYLE5"><%=(Recordset2.Fields.Item("成品ID").Value)%></div></td>      <td width="75"><div align="center" class="STYLE5"><%=(Recordset2.Fields.Item("商品编码").Value)%></div></td>      <td width="75"><div align="center" class="STYLE5"><%=(Recordset2.Fields.Item("附加编码").Value)%></div></td>      <td width="285"><div align="center" class="STYLE5"><%=(Recordset2.Fields.Item("商品名称").Value)%></div></td>      <td width="80"><div align="center" class="STYLE5"><%=(Recordset2.Fields.Item("计量单位").Value)%></div></td>      <td width="100"><div align="center" class="STYLE5"><%=(Recordset2.Fields.Item("法定计量单位").Value)%></div></td>      <td width="90"><div align="center" class="STYLE5"><%=(Recordset2.Fields.Item("申报数量").Value)%></div></td>      <td width="90"><div align="center" class="STYLE5"><%=(Recordset2.Fields.Item("申报单价").Value)%></div></td>    </tr>  </table>  <%   Repeat1__index=Repeat1__index+1  Repeat1__numRows=Repeat1__numRows-1  Recordset2.MoveNext()Wend%><br /><span class="STYLE7">出口制成品及对应进口料件消耗备案清单</span><table width="900" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#99CCFF">  <tr>    <td width="160"><div align="center" class="STYLE8">成品ID</div></td>    <td width="240"><div align="center" class="STYLE8">原料名称</div></td>    <td width="238"><div align="center" class="STYLE8">规格型号</div></td>    <td width="115"><div align="center" class="STYLE8">单耗</div></td>    <td width="115"><div align="center" class="STYLE8">损耗</div></td>  </tr></table><% While ((Repeat2__numRows <> 0) AND (NOT Recordset3.EOF)) %>  <table width="900" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#99CCFF">    <tr>      <td width="160"><div align="center" class="STYLE5"><%=(Recordset3.Fields.Item("成品ID").Value)%></div></td>      <td width="240"><div align="center" class="STYLE5"><%=(Recordset3.Fields.Item("原料名称").Value)%></div></td>      <td width="238"><div align="center" class="STYLE5"><%=(Recordset3.Fields.Item("规格型号").Value)%></div></td>      <td width="115"><div align="center" class="STYLE5"><%=(Recordset3.Fields.Item("单耗率").Value)%></div></td>      <td width="115"><div align="center" class="STYLE5"><%=(Recordset3.Fields.Item("损耗率").Value)%></div></td>    </tr>  </table>  <%   Repeat2__index=Repeat2__index+1  Repeat2__numRows=Repeat2__numRows-1  Recordset3.MoveNext()Wend%></body></html><%Recordset1.Close()Set Recordset1 = Nothing%><%Recordset2.Close()Set Recordset2 = Nothing%><%Recordset3.Close()Set Recordset3 = Nothing%> 



[解决办法]
where重复
HTML code
 <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> 
<!--#include file="Connections/conn.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = ""
If (Request.Form("select1") <> "") Then
Recordset1__MMColParam = Request.Form("select1")
end if

Dim Recordset2__MMColParam
Recordset2__MMColParam = ""
If (Request.Form("select2") <> "") Then
Recordset2__MMColParam = Request.Form("select2")
end if

Dim Recordset3__MMColParam
Recordset3__MMColParam = ""
If (Request.Form("select3") <> "") Then
Recordset3__MMColParam = Request.Form("select3")
end if

Dim Recordset1
Dim strSql
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn_STRING
strSql="SELECT * FROM í¨1?ê?2á "
If Recordset1__MMColParam <>""then
  strSql=strSql & " WHERE ê?2á±ào? = '" & Recordset1__MMColParam & "'"
end if
Recordset1.source=strSql
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
Dim Recordset2
Dim Recordset2_numRows

Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_conn_STRING
strSql="SELECT *FROM 3??ú3é?· "
strSql=strSql & " WHERE 1 = 1 "
If Recordset1__MMColParam <>""then
  strSql=strSql & " AND ê?2á±ào? = '" & Recordset1__MMColParam & "'"
end if
If Recordset2__MMColParam <>""then
  strSql=strSql & " AND éì?·??3? = '" & Recordset2__MMColParam & "'"
end if
strSql=strSql & " ORDER BY 3é?·ID ASC"
Recordset2.source=strSql
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()

Recordset2_numRows = 0
%>
<%
Dim Recordset3
Dim Recordset3_numRows

Set Recordset3 = Server.CreateObject("ADODB.Recordset")
Recordset3.ActiveConnection = MM_conn_STRING
strSql="SELECT *FROM 3??ú??3é?·?°??ó|???úá??t??o?±?°???μ¥ "
strSql=strSql & " WHERE 1 = 1 "
If Recordset1__MMColParam <>""then
  strSql=strSql & " AND ê?2á±ào? = '" & Recordset1__MMColParam & "'"
end if
If Recordset3__MMColParam <>""then
  strSql=strSql & " AND 3é?·ID = '" & Recordset3__MMColParam & "'"
end if
strSql=strSql & " ORDER BY 3é?·ID ASC"
Recordset3.source=strSql
Recordset3.CursorType = 0
Recordset3.CursorLocation = 2
Recordset3.LockType = 1
Recordset3.Open()

Recordset3_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recordset2_numRows = Recordset2_numRows + Repeat1__numRows
%>
<%
Dim Repeat2__numRows
Dim Repeat2__index

Repeat2__numRows = -1
Repeat2__index = 0
Recordset3_numRows = Recordset3_numRows + Repeat2__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>?T±êìa??μμ </title>
<style type="text/css">
<!--
.STYLE5 {font-size: 14px}
.STYLE7 {  font-size: 18px;
  font-family: "??ì?_GB2312";
}
.STYLE8 {font-size: 15px; }
-->
</style>
</head>

<body>
<table width="900" height="50" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#99CCFF">
<tr>
  <td> <div align="center" class="STYLE5">ê?2á±ào? </div> </td>
  <td> <div align="center" class="STYLE5"> <%=(Recordset1.Fields.Item("ê?2á±ào?").Value)%> </div> </td>
  <td> <div align="center" class="STYLE5">é걨è??ú </div> </td>
  <td> <div align="center" class="STYLE5"> <%=(Recordset1.Fields.Item("é걨è??ú").Value)%> </div> </td>
  <td> <div align="center" class="STYLE5">óDD§è??ú </div> </td>
  <td> <div align="center" class="STYLE5"> <%=(Recordset1.Fields.Item("óDD§è??ú").Value)%> </div> </td>
</tr>
<tr>
  <td> <div align="center" class="STYLE5">?óòμ?ú2?±ào? </div> </td>
  <td> <div align="center" class="STYLE5"> <%=(Recordset1.Fields.Item("?óòμ?ú2?±ào?").Value)%> </div> </td>
  <td> <div align="center" class="STYLE5">?-óaμ¥?? </div> </td>
  <td> <div align="center" class="STYLE5"> <%=(Recordset1.Fields.Item("?-óaμ¥??").Value)%> </div> </td>
  <td> <div align="center" class="STYLE5">?ó1¤μ¥?? </div> </td>
  <td> <div align="center" class="STYLE5"> <%=(Recordset1.Fields.Item("?ó1¤μ¥??").Value)%> </div> </td>
</tr>
</table>
<br />
<span class="STYLE7">3??ú3é?· </span>
<table width="900" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#99CCFF">
<tr>
  <td width="55"> <div align="center" class="STYLE5">3é?·ID </div> </td>
  <td width="75"> <div align="center" class="STYLE5">éì?·±à?? </div> </td>
  <td width="75"> <div align="center" class="STYLE5">???ó±à?? </div> </td>
  <td width="285"> <div align="center" class="STYLE5">éì?·??3? </div> </td>
  <td width="80"> <div align="center" class="STYLE5">??á?μ¥?? </div> </td>
  <td width="100"> <div align="center" class="STYLE5">·¨?¨??á?μ¥?? </div> </td>
  <td width="90"> <div align="center" class="STYLE5">é걨êyá? </div> </td>
  <td width="90"> <div align="center" class="STYLE5">é걨μ¥?? </div> </td>
</tr>


</table>

<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset2.EOF))
%>
<table width="900" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#99CCFF">
  <tr>
  <td width="55"> <div align="center" class="STYLE5"> <%=(Recordset2.Fields.Item("3é?·ID").Value)%> </div> </td>
  <td width="75"> <div align="center" class="STYLE5"> <%=(Recordset2.Fields.Item("éì?·±à??").Value)%> </div> </td>
  <td width="75"> <div align="center" class="STYLE5"> <%=(Recordset2.Fields.Item("???ó±à??").Value)%> </div> </td>
  <td width="285"> <div align="center" class="STYLE5"> <%=(Recordset2.Fields.Item("éì?·??3?").Value)%> </div> </td>
  <td width="80"> <div align="center" class="STYLE5"> <%=(Recordset2.Fields.Item("??á?μ¥??").Value)%> </div> </td>
  <td width="100"> <div align="center" class="STYLE5"> <%=(Recordset2.Fields.Item("·¨?¨??á?μ¥??").Value)%> </div> </td>
  <td width="90"> <div align="center" class="STYLE5"> <%=(Recordset2.Fields.Item("é걨êyá?").Value)%> </div> </td>
  <td width="90"> <div align="center" class="STYLE5"> <%=(Recordset2.Fields.Item("é걨μ¥??").Value)%> </div> </td>
  </tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset2.MoveNext()
Wend
%>
<br />
<span class="STYLE7">3??ú??3é?·?°??ó|???úá??t??o?±?°???μ¥ </span>
<table width="900" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#99CCFF">
<tr>
  <td width="160"> <div align="center" class="STYLE8">3é?·ID </div> </td>
  <td width="240"> <div align="center" class="STYLE8">?-á???3? </div> </td>
  <td width="238"> <div align="center" class="STYLE8">1???Dío? </div> </td>
  <td width="115"> <div align="center" class="STYLE8">μ¥o? </div> </td>
  <td width="115"> <div align="center" class="STYLE8">?eo? </div> </td>
</tr>
</table>

<%
While ((Repeat2__numRows <> 0) AND (NOT Recordset3.EOF))
%>
<table width="900" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#99CCFF">
  <tr>
  <td width="160"> <div align="center" class="STYLE5"> <%=(Recordset3.Fields.Item("3é?·ID").Value)%> </div> </td>
  <td width="240"> <div align="center" class="STYLE5"> <%=(Recordset3.Fields.Item("?-á???3?").Value)%> </div> </td>
  <td width="238"> <div align="center" class="STYLE5"> <%=(Recordset3.Fields.Item("1???Dío?").Value)%> </div> </td>
  <td width="115"> <div align="center" class="STYLE5"> <%=(Recordset3.Fields.Item("μ¥o??ê").Value)%> </div> </td>


  <td width="115"> <div align="center" class="STYLE5"> <%=(Recordset3.Fields.Item("?eo??ê").Value)%> </div> </td>
  </tr>
</table>
<%
Repeat2__index=Repeat2__index+1
Repeat2__numRows=Repeat2__numRows-1
Recordset3.MoveNext()
Wend
%>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
Recordset2.Close()
Set Recordset2 = Nothing
%>
<%
Recordset3.Close()
Set Recordset3 = Nothing
%>

热点排行