当前位置:首页
开发技术指南» 文章正文
    引言:

    摘要: 书上说,二维数组名就是指针的指针。数组名是指向二维数组的行地址存储空间的首地址,也就是指针数组。那么: int a[3][3] = {1,2,3,4,5,6,7,8,9}; a -> a[0] a[1] a[2] a[0]-> 1 2 3 a[1]-> 4 5 6 a[2]-> 7 8 9 如果: int **p; p = a; 为什么p就能等价于a了呢?我真的是想......
 ·删除表数据时太慢的原因    »显示摘要«
    摘要: 经过一年多的运行,历史数据和过程化数据越积越多,准备清除一下。[有选择删除] 但有个表删除数据很慢,发现它的索引(3个,其中有一个联合索引)和外键(5个)都比较多,请问主要是什么原因导致的?我应该采用什么措施(譬如先去除索引,删掉后再加上?)? 谢谢! ......


select无法选中传递的值

请大家看一下我这段程序  
  <tr>  
        <TD   HEIGHT="40"   width="106">选择营业部</TD>  
        <TD   HEIGHT="40"   width="324">  
              <select   size="1"   name="reportag02"   onchange="window.open(表.asp?jg=<%=jigou%>&glchu=<%=guanlichu%>&yyb=+this.options[this.selectedIndex].value,_self)">  
              <option   value="%">全部</option>  
  <%      
  sql   =   "   select   distinct   id,name   from   list   where   "  
  sql   =   sql   &   "   col   like   "&guanlichu&"%   group   by   id,name   order   by   id   "  
  Set   glc   =   sqlconn.execute(sql)    
  Do   until   glc.Eof     %>  
              <option   value="<%=glc("id")   %>   "<%   if   glc("id")=   yingyebu   then%>selected<%end   if   %>><%=glc(1)   &glc(0)%></option>  
  <%  
      glc.MoveNext  
      Loop  
  %>  
  </select>  
      </TD>          
  </tr>  
  我希望当该页面因为下拉框改变而刷新时,下拉框中选中项保持不变,但是现在,如果我选择name和id是相同的数字的选项时,if判断就会失效,该下拉框就会选择“全部”而如果选择name是汉子,id是数字的选项时,if判断就正常,请问这是什么原因。数据库中id和name字段都是char型。

NO.1   作者: itzhiren

<option   value="<%=glc("id")   %>   "<%   if   glc("id")=   yingyebu   then%>selected<%end   if   %>><%=glc(1)   &glc(0)%></option>  
   
  变量yingyebu在哪儿获取?

NO.2   作者: ybfqlyq

<option   value="<%=glc("id")   %>   "<%   if   glc("id")=   request("yingyebu")   then%>selected<%end   if   %>><%=glc(1)   &glc(0)%></option>

NO.3   作者: legend1970

换成着一句:  
  <option   value="<%=glc("id")   %>"   <%   if   glc("id")=   yingyebu   then%>   selected<%end   if   %>><%=glc(1)   &glc(0)%></option>  
   
  全部换成这样呢!我这样是可以的,表.asp更名为table.asp,最好不用中文:  
  <tr>  
        <TD   HEIGHT="40"   width="106">选择营业部</TD>  
        <TD   HEIGHT="40"   width="324">  
              <select   size="1"   name="reportag02"   onChange=parent.location.href=this.form.select.options[this.form.select.selectedIndex].value,_self)">  
              <option   value="%">全部</option>  
  <%      
  sql   =   "   select   distinct   id,name   from   list   where   "  
  sql   =   sql   &   "   col   like   "&guanlichu&"%   group   by   id,name   order   by   id   "  
  Set   glc   =   sqlconn.execute(sql)    
  Do   until   glc.Eof     %>  
  <option   value="table.asp?jg=<%=jigou%>&glchu=<%=guanlichu%>&yyb=<%=glc("id")%>"   <%   if   glc("id")=   yingyebu   then%>   selected<%end   if   %>><%=glc(1)   &glc(0)%></option>  
  <%  
      glc.MoveNext  
      Loop  
  %>  
  </select>  
      </TD>          
  </tr>  
 

NO.4   作者: oneway888

得到选择的值,有两种情况做  
  一种是request,另一种是javascript   document.all.selectname.options[]......

NO.5   作者: mmylmj

在判断语句都加上cstr这个函数试一下,比如:  
  if   cstr(glc("id"))=   cstr(yingyebu)   then   ^

NO.6   作者: itzhiren

变量yingyebu确定有值么?  
  <tr>  
        <TD   HEIGHT="40"   width="106">选择营业部</TD>  
        <TD   HEIGHT="40"   width="324">  
              <select   size="1"   name="reportag02"   onchange="window.open(表.asp?jg=<%=jigou%>&glchu=<%=guanlichu%>&yyb=+this.options[this.selectedIndex].value,_self)">  
              <option   value="%">全部</option>  
  <%      
  sql   =   "   select   distinct   id,name   from   list   where   "  
  sql   =   sql   &   "   col   like   "&guanlichu&"%   group   by   id,name   order   by   id   "  
  Set   glc   =   sqlconn.execute(sql)  
  response.write   yingyebu&"ok"    
  Do   until   glc.Eof     %>  
              <option   value="<%=glc("id")   %>   "<%   if   glc("id")=   yingyebu   then%>selected<%end   if   %>><%=glc(1)   &glc(0)%></option>  
  <%  
      glc.MoveNext  
      Loop  
  %>  
  </select>  
      </TD>          
  </tr>  
  看看输出什么?


    摘要: 如题 ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE