当前位置:首页 » 多媒体相关

用VBscript来写数组的问题。很急。在线等带。


dim   icount  
  dim   chkarray=new   array()  
  if   request("auser")>""   then  
  chkarray=split(request("auser"),",")  
  for   icount=0   to   ubound(chkarray)    
          sql=sql+"   select   *   from   table   where   name="&chkarrayp[icount]&"  
  next  
  rs.open   sql,conn,1,3  
   
  end   if  
  请问我这样写哪儿有错呀。请各位帮帮我。  
  我的request("auser")取出的是一些字符直,有很多的。  
  谢谢各位了。

推荐阅读

  • 冯必乐称股东大会将不公布手机部门整改方案 [详细内容]
  • 让彩色光标出现在Delphi程序中 [详细内容]
  • 2分钟快速打造自己喜欢的S700待机图片 [详细内容]
  • 西门子手机前景分析:想卖也不是容易的事 [详细内容]
  • Delphi中动画设计 [详细内容]
  • 2分钟轻松制作自己喜欢的S700酷炫铃声 [详细内容]
  • 西门子第一季获利增长5% 手机部门亏损1.43亿 [详细内容]
  • 网友回答:
    网友:saucer

    dim   icount  
      dim   chkarray=new   array()  
      if   request("auser")   <>   ""   then  
          chkarray=split(request("auser"),",")  
          sql   =   "select   *   from   table   where   name   in   ("  
          for   icount=0   to   ubound(chkarray)    
              sql   =   sql+   ""   &   chkarray(icount)   &   ""  
              if   icount   <>   ubound(chkarray)   then  
                sql   =   sql   +   ","  
              end   if  
        next  
          sql   =   sql   +   ")"  
      rs.open   sql,conn,1,3  
      ....  
      end   if

    网友:jaron

    不要把   select   ...   from   ...   也写进去,你这样写生成了  
       
      select   ...   from   ...select   ...   from   ...select   ...   from   ...select   ...   from   ...  
       
      按楼上的做即可。

    网友:zorou_fatal

    同意。

    网友:bananasmiling

    dim   icount  
      dim   chkarray=new   array(3)  
      if   request("auser")   <>   ""   then  
          chkarray=split(request("auser"),",")  
          sql   =   "select   *   from   table   where   name   in   ("  
          for   icount=0   to   ubound(chkarray)    
              sql   =   sql+   ""   &   chkarray(icount)   &   ""  
              if   icount   <>   ubound(chkarray)   then  
                sql   =   sql   +   ","  
              end   if  
        next  
          sql   =   sql   +   ")"  
      rs.open   sql,conn,1,3  
      ....  
      end   if  
     

    网友:swans

    vbscript中没有new   array()这种用法...  
      把这句改成  
      dim   chkarray=new   array()==>dim   chkarray  
       
     

    网友:chinascprogram

    同意楼上   up

    网友:jackyzhao213

    javascript才会var   aaa=new   array(),  
      vbscript   定义数组是dim   aaa(3),  
      或dim   aaa()  
      redim   aaa(3)

    网友:summercat

    多此一举吧~~这样  
      dim   icount  
      dim   chkarray()  
      if   request("auser")   <>   ""   then  
          sql   =   "select   *   from   table   where   name   in   ("&request("auser")&")"  
      rs.open   sql,conn,1,3  
      end   if  
     

    网友:summercat

    dim   icount  
      if   request("auser")   <>   ""   then  
          sql   =   "select   *   from   table   where   name   in   ("&request("auser")&")"  
      rs.open   sql,conn,1,3  
      end   if

    网友:summercat

    if   request("auser")   <>   ""   then  
          sql   =   "select   *   from   table   where   name   in   ("&request("auser")&")"  
          rs.open   sql,conn,1,3  
      end   if

    网友:windancer

    同意:  
      回复人:   summercat(飘轩)   (   )   信誉:110     2003-08-15   10:18:00     得分:0    
         
         
          if   request("auser")   <>   ""   then  
          sql   =   "select   *   from   table   where   name   in   ("&request("auser")&")"  
          rs.open   sql,conn,1,3  
      end   if  
           
         
       
     

    网友:sailor001

    dim   icount  
      dim   chkarray  
      if   request("auser")   <>   ""   then  
          chkarray=split(request("auser"),",")  
          sql   =   "select   *   from   table   where   name   in   ("  
          for   icount=0   to   ubound(chkarray)-1    
              sql   =   sql+   ""   &   chkarray(icount)   &   ""  
              if   icount   <>   ubound(chkarray)   then  
                sql   =   sql   +   ","  
              end   if  
        next  
          sql   =   sql   +   ")"  
      rs.open   sql,conn,1,3  
      ....  
      end   if

    .

    讨论区

    Login