你是不是应该改变一下
datagrid1的recordsource?
然后再refresh?

解决方案 »

  1.   

    Private Sub Command1_Click()
    Adodc_index.RecordSource = "select * from table1 where ID = '1000022'"
    Adodc_index.Refresh
    DataGrid1.Refresh
    End Sub
      

  2.   

    adodc1.refresh 
    改变其数据源
      

  3.   

    Adodc_index.recordset.open = "select * from table1 where ID = '1000022'"set datagrid.datasource=adodc_index.recordset
      

  4.   

    Set rsInspection = New ADODB.Recordset
                     With rsInspection
                         .CursorType = adOpenStatic
                         .CursorLocation = adUseClient
                         .LockType = adLockPessimistic
                         .Source = "SELECT * FROM tblpropertyspec WHERE property ='" & adoProperty.Recordset.Fields("property") & "'"
                     Set .ActiveConnection = cnnCMMS
                         .Open
                     End With                 set dattagrid1.datasource=nothing
                     Set DataGrid1.DataSource = rsInspection
      

  5.   

    strSQLCha = "select * from 销售表 where " & strFindID
    Rst2.Open strSQLCha, Cnn1, adOpenStatic, adLockPessimistic
    Set DataGrid1.DataSource = Rst2
      

  6.   

    如果用Adodc_index.Refresh则会出现“FROM子句出现错误”!这么回事????
      

  7.   

    Private Sub Command1_Click()
    Adodc_index.RecordSource = "select * from table1 where ID = '1000022'"
    Adodc_index.refresh
    set datagrid1.datasource=adodc_index.recordsource
    DataGrid1.Refresh
    End Sub
      

  8.   

    楼上的:用你的方法提示“编译错误:要求对象”并且黄色提示条停留在Adodc_index.recordsource的.recordsource的地方。
      

  9.   

    写错了
    改正如下:Private Sub Command1_Click()
    Adodc_index.RecordSource = "select * from table1 where ID = '1000022'"
    Adodc_index.refresh
    set datagrid1.datasource=adodc_index.recordset
    DataGrid1.Refresh
    End Sub
      

  10.   

    = "select * from table1 where ID = 1000022"
      

  11.   

    原来必须是 abCmText 而不是 abCmTable 然后填写命令代码 select  *  from  table1  where  ID  =  1000022