-1

到达时con.open(),我收到错误消息。

Imports System.Data.OleDb
Public Class Form1
Dim con As OleDbConnection
Dim strCon As String = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=C:\testDB.accdb"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
con = New OleDbConnection(strCon)
con.Open()
MsgBox("con open")
con.Close()
MsgBox("con closed")

End Sub
End Class
4

1 回答 1

1

没有错误很难说,但可能是权限问题?

右键单击 testDB.accdb 文件,Properties, Security, Edit, Add,输入“每个人”,单击Check Names, OkFull Control当每个人都突出显示时勾选复选框,然后再Ok两次。

于 2013-05-09T13:51:36.697 回答