Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=pubs;Data Source=pubs (SQL Server)"
      Adodc1.Recordset.Open "select * from 供货商", Cnn, adOpenKeyset, adLockOptimistic (对象变量或with块变量未设置)

解决方案 »

  1.   

    adodc 1要怎么定义  ?
      

  2.   

     对象变量或with块变量未设置----一般由于对象变量没有赋到值造成的
      

  3.   

    Adodc1.Recordset.Open "select * from 供货商"就行了,后面的Cnn没必要,代码中前面也没说明
      

  4.   

    Adodc1.Recordset.Open "select * from 供货商"
    就可以了
    你已经给adodc1一个connectionstring了;不需要后面的cnn再说,cnn你定义过了么,实例化了么
      

  5.   


    Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=pubs;Data Source=pubs (SQL Server)"
    Adodc1.RecordSource = "select * from [供货商]"
    Adodc1.Refresh