我初学vb 数据库连接,怎么老是报错呢?
Private Sub CommandButton1_Click()Set DBSERVER = New ADODB.Connection
Set Rs = New ADODB.Recordset
DBSERVER.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & App.Path & "\" & "xinxi.mdb;Persist Security Info=False" ' "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path + "\xinxi.mdb"
MsgBox DBSERVER.State ‘结果为1
Rs.Open "Select * From jichu " '此处报错,连接无法用于执行此操作。在此上下文中它可能已被关闭或无效
End Sub