select数据库

2006-08-15 00:00:00 by 【6yang】, 30 visits, 收藏 | 返回
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<tr>  
  <td   class=forumrow   width="93">  
  <p   align="right">产品主类:</td>  
  <td   class=forumrow   width="484">  
   
   
  <SELECT   id=lx   name=lx     onchange="display(document.all('lx').value)"   style="WIDTH:100px">    
        <%        
          dim   rs  
          dim   sql  
                  cn.open  
                  set   rs   =   server.createObject("ADODB.RecordSet")  
  sql   =   "select   *   from   qymllxb     order   by   id"  
  rs.open   sql,cn,1,3  
  if   rs.eof   then  
  Response.Write"无类型可选!"  
  else    
  Response.Write"<option   value='0'>请选择</option>"  
  do   while   not   rs.eof  
  Response.Write"<option   value='"&   rs("lx")   &"'>"&   rs("lx")   &"</option>"  
  rs.movenext  
  loop  
  rs.close  
  set   rs   =   nothing  
  cn.close  
  end   if  
          %>                                                                                  
  </SELECT>  
   
  </td>  
  </tr>  
  <SCRIPT   LANGUAGE=vbscript   >    
  dim   i,j,choice(2,100)  
      <%  
      dim   i,j,choicea(2,100)      
      cn.open  
      set   rs   =   server.createObject("ADODB.RecordSet")  
      sql="select   *   from   qymlzlxb   order   by   id"  
      rs.open   sql,cn,1,3  
      zlxs=rs.RecordCount  
      for   i=0   to   zlxs-1      
      choicea(1,i)=rs("zlx")  
      choicea(2,i)=rs("lx")  
      rs.MoveNext    
      next  
      cn.close  
      %>    
   
  <%for   i=0   to   zlxs-1%>  
  choice(1,<%=i%>)   =   "<%=choicea(1,i)%>"  
  choice(2,<%=i%>)   =   "<%=choicea(2,i)%>"  
  <%next%>  
            sub     display(obj)  
  document.all("flx").length   =0    
  for   i=0   to   ubound(choice,2)      
  if   choice(2,i)=obj   then        
  set   opt=document.createElement("OPTION")          
  opt.text=choice(1,i)  
  opt.value=choice(1,i)  
  document.all("flx").add(opt)        
  end   if  
  next  
  end   sub  
  </SCRIPT>  
  <tr>  
  <td   class=forumrow   width="93">  
  <p   align="right">产品分类:</td>  
  <td   class=forumrow   width="484">  
  <SELECT   id=flx   name=flx   style="WIDTH:100px">  
          <option   value=""></option>    
  </SELECT>  
  </td>  
  </tr>
</body>
</html>
分享到:
share

    图片原图

    loading

    loading