我一般是直接写程序打开数据库,下面的是我用的程序:
Private Sub Form_Activate()
Dim s As String
s = App.Path & "\assart.mdb" '把数据库放在编程的文件夹内,安装时把数据库放在文件夹内
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source =" + Chr(34) + s + Chr(34) & ";Jet OLEDB:Database Password=chen23;"
'打开有密码数据库,密码为“chen23”
'"Data Source =" + Chr(34) + s + Chr(34) & ";Persist Security Info=False"
'打开无密码数据库
Dim SQL As String
SQL = "SELECT * FROM 评估审核表
"
= adCmdunknow
Adodc1.RecordSource = SQL
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End Sub