Public conn As New ADODB.Connection
Public rs As New ADODB.Recordset
Private Sub Form_Load()
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Data.mdb;Mode=ReadWrite|Share Deny None;Persist Security Info=False"
End sub
Private Sub command1_Click()
SQL = "Select v_name from data1"
rs.Open SQL, conn, 3, 3
For i = 0 To List1.ListCount - 1
rs.AddNew
rs("v_name") = List1.List(i)
Next
rs.Close '加上出现 “在此环境中不允许操作” !不加rs.Close的话虽然可以!但是再次单击command1就出现“对象打开时,不允许操作”
End Sub