代码如下
Private Sub Del_Click()
Adodc1.RecordSource = "delete from second where   " + "控件名称 = " + "'" + DataGrid1.Columns(1).Value + "'"       (这句代码原来在一行里)
Adodc1.RefreshEnd Sub
一运行就出错
错误3704:如果对象关闭,则不允许应用程序请求的操作

解决方案 »

  1.   

    同意楼上的,ADODC的ConnectionString设置如下所示:
    Adodc1.ConnectionString = "Provider=SQLOLEDB.1;" & _
        "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Ts_Song;Data Source=E200"
    Aodoc1.RecordSource = "Select * from SongTT order by singer"
    Adodc1.Refresh
      

  2.   

    设置了,在Form_load()中已设置了,我这个模块实现在DataGrid中选中一条记录,然后,按表单上的控件按钮,用程序将其删除