就是我在数据库关联时,用了二个adodc控件,把adodc1加载了数据源。adodc2没有加载数据源,想通过sql语句把adodc1中的符合条件的记录作为adodc2的数据源。  在运行时就出现了,上面的问题。  不知道怎么解决。

解决方案 »

  1.   

    With adodc1
         .ConnectionTimeout = 50
         .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=data.mdb;Persist Security Info=false"
         .CommandTimeout = 50
         .CommandType = adCmdText
    End WithWith adodc1
         .ConnectionTimeout = 50
         .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=data.mdb;Persist Security Info=false"
         .CommandTimeout = 50
         .CommandType = adCmdText
    End With 
    adodc1.recordSource = "select * from table where ..."
    adodc1.refresh 
    adodc2.RecordSource=adodc1.Recordsource
    adodc2.refresh
      

  2.   

    '上面的写错了,不好意思!
    With adodc1
         .ConnectionTimeout = 50
         .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=data.mdb;Persist Security Info=false"
         .CommandTimeout = 50
         .CommandType = adCmdText
    End WithWith adodc2
         .ConnectionTimeout = 50
         .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=data.mdb;Persist Security Info=false"
         .CommandTimeout = 50
         .CommandType = adCmdText
    End With 
    adodc1.recordSource = "select * from table where ..."
    adodc1.refresh 
    adodc2.RecordSource=adodc1.Recordsource
    adodc2.refresh
      

  3.   

    你的SQL语句怎么写的,贴出来看看!