VB +access 这样连接 为什么会提示错误?
Dim conn As New ADODB.connection
Dim rs As New ADODB.Recordset
Dim str As String
Dim intdb As Integer
conn.CursorLocation = adUseClient
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=;Data Source= " & App.Path & "\school.mdb;Persist Security Info=False "
Set rs = conn.Execute( "select * from news ")
fg.Rows = 0
fg.Rows = 2
fg.FixedRows = 1
Set fg.DataSource = rs
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
[解决办法]
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\db_exp.mdb;Persist Security Info=False "
这个正确
楼主对比一下
[解决办法]
'这样试试
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=;Data Source= " & App.Path & "\school.mdb;Persist Security Info=False "
rs.open "select * from news ",conn,adopenkeyset,adlockreadonly
Set fg.DataSource = rs