把数据库连接语句加到模块里面

来源:互联网 发布:unity3d寻路插件 编辑:程序博客网 时间:2024/05/01 21:24

模块这儿先定义:

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

原创粉丝点击