vb 指定的初始化字符串不符合OLE DB 规定
发布网友
发布时间:2024-10-17 19:24
我来回答
共1个回答
热心网友
时间:2024-12-13 21:39
改成下面的代码试试
Public db As New ADODB.Connection
Public RS As New ADODB.Recordset
Public Sub SJK(db As ADODB.Connection) '连接数据库过程
Dim ConnectionString As String
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = ' & App.Path & '\db.mdb;Persist Security Info=False"
db.ConnectionString = ConnectionString
db.Open (ConnectionString)
End Sub
追问谢谢,但是我改了之后还是出现一样的错误,请问还有什么方法吗?
追答更改成:ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & App.Path & "\db.mdb;Persist Security Info=False"