如果查询很简单,直接在RECORDSET中使用FILTER就行了

解决方案 »

  1.   

    strsql必须自己全部重新写的for example:select book.书名,book.分类号,borrow.借出日期 from book inner join borrow " _
                    & " on book.bookID = borrow.bookID where readerID=" & ReaderID & " book.分类号 in [....]"
    不能使用adodc的
      

  2.   

    另外你也可以试试这个
    select * from (select * from book wher ....) as a where ....
      

  3.   

    dim strSql as string
    strsql=adodc1.RecordSource
    adodc2.RecordSource="select * from (" & strsql & ") as a where " & [你的条件]
      

  4.   

    strSQL = "select * from Adodc1 where 分类号 in [select * from adodc2 ]",呵呵,你还很能创造哦。
    如果你对性能关心呢,使用上面的代码,注意,in子句必须只返回一列,用
    *不行的,明确指明列名。如果不关心性能,在客户端装配strSQL好了,
    strSQL = "("
    While not adoRS1.eof
     strSQL = strSQL & adoRS1.fileds("ddd").value
     adoRS.movenext
    wend
    adors.close
    strSQL = "select * from Adodc1 where 分类号 in " & strSQL & ")"
    再执行。
      

  5.   

    我用的是access2000,不知道能否支持复杂的SQL查询。时间很紧呢,头都想大了。
    select * from Adodc1 这样写肯定是不对的,但我要表达的就是这个意思。心里有点模糊,不知道这个功能怎么实现,唉,多表查询!4个表。
      

  6.   

    没关系,你尽管写,你所未的复制不会超出ACCESS驱动能处理的情况,
    确实,手工书写SQL语句会有很大的性能好处。
      

  7.   

    经过网友Framer的QQ在线指导,终于知道怎么用查询了。但现在又出现了新的问题。请见帖子:
    http://www.csdn.net/expert/topic/656/656744.xml?temp=.3842127这个帖子就不要再回了,我要结帖了。