还有一个问题:我要做一个组合框的查询,有6个组合框,可以任意组合查询,我现在不知要怎么写代码,因为6个组框可以组成25种查询,我现在的思路是:select case 1 
case 2
case 3
这样写不是要写25个吗?
有没有好点的办法?

解决方案 »

  1.   

    写存储过程啦.只不过是加个WHERE而已嘛.判断一个就加一下.
      

  2.   

    我是用vb+accsee,都可以写存储过程吗?具体怎么写?我是菜鸟!
      

  3.   

    dim sqlstr as string
    sql="1=1"
    if combo1.text<>"" then
       sql=sql & " and " & combo1.txt
    end if
    if combo2.text<>"" then
       sql=sql & " and " & combo2.txt
    end if
    if combo3.text<>"" then
       sql=sql & " and " & combo3.txt
    end if
    .....
    只要六句