模块这儿先定义:
Public file As String
Public a As String
在登陆窗这儿赋值:
file = App.Path & "/" & "data.mdb"
a="Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & file & "';Jet OLEDB:Database
password=123456;Persist Security Info=false"
调用连接语句:
Adodc1.ConnectionString = a
或者dbs.Open a