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

 ·html:select中如何使用css    »显示摘要«
    摘要: html:select中如何使用css? 比如我有个css是common.css,其中有个".tdstyle{ width: 372px}" 我在html:select怎么调用common.css中的".tdstyle{ width: 372px}"? html:select中没有class属性. ......
 ·    »显示摘要«
    摘要: 如何把一个int型的变量用messagebox输出啊,小弟初学mfc ......


还是模糊查询的问题,,小弟在线等

Private   Sub   Command3_Click()  
      On   Error   GoTo   askerr2  
      If   Combo3.ListIndex   <   0   Then  
          MsgBox   "请先设置查询条件,选择要查询的字段",   vbOKOnly,   "提示"  
      ElseIf   Combo4.ListIndex   <   0   Then  
          MsgBox   "请先设置查询条件,选择操作符",   vbOKOnly,   "提示"  
      ElseIf   Text2.text   =   ""   Then  
          MsgBox   "请先输入要查询的值",   vbOKOnly,   "提示"  
      Else  
           
          If   Combo4.text   =   "模糊查询"   Then  
          strfilter2   =   "select   *   from   用户数据表     where   Combo3.list(Combo3.ListIndex)   like   %"   &   Trim(Text2.text)   &   "%"  
          ElseIf   Combo4.text   =   "精确查询"   Then  
           
          strfilter2   =   "select   *   from   用户数据表     where   "   &   Combo3.list(Combo3.ListIndex)   &   "   "   &   "="   &   "   "   &   ""   &   Trim(Text2.text)   &   ""  
          End   If  
          Adodc2.RecordSource   =   strfilter2  
          Adodc2.Refresh  
           
        If   Err.Number   <>   0   Then  
           
              msg   =   "查询条件出错,查询的值与字段类型不匹配,请重新设置查询条件!"  
              MsgBox   msg,   ,   "出错",   Err.HelpFile,   Err.HelpContext  
        Else  
          MsgBox   "总共查询到"   +   CStr(Adodc2.Recordset.RecordCount)   +   "条记录,详细内容见上表",   vbOKOnly,   "查询结果提示"  
        End   If  
      End   If  
      Exit   Sub  
  askerr2:  
        MsgBox   "查询条件出错,查询的值与字段类型不匹配,请重新设置查询条件!"  
  End   Sub  
  模糊查询总是直接跳到askerr2了,但是精确查询没有任何问题,曾经把精确查询的=改成like,用作模糊查询,还是不行  
  哪位英雄帮小弟我解决一下

NO.1   作者: sqfeiyu

strfilter2   =   "select   *   from   用户数据表     where   "   &   Combo3.list(Combo3.ListIndex)   &   "like   %"   &   Trim(Text2.text)   &   "%"  
 

NO.2   作者: guoyx

你把你的strfilter2变量debug.print出来,放到查询分析器看看是什么错误!

NO.3   作者: yoki

strfilter2   =   "select   *   from   用户数据表     where     "   &   Combo3.list(Combo3.ListIndex)   &   "     like   %"   &   Trim(Text2.text)   &   "%"  
   
  注意空格!!

NO.4   作者: lk_cool

同上  
   
  去掉  
  On   Error   GoTo   askerr2  
  看看你的错误  
   
   
  你可能还不是  
  很了解‘’   “”   的含义  
 

NO.5   作者: mmcgzs

strfilter2   =   "select   *   from   用户数据表     where   "   &   Combo3.list(Combo3.ListIndex)   &   "   like   %"   &   Trim(Text2.text)   &   "%"  
   
  楼上的少了一个空格


    摘要: 谁有stl源码剖析--侯捷.pdf完整的版本下载啊。 ......
» 本期热门文章:

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