vb中ADO连接数据库
PrivateSubForm_Load()IfCN.StateThenCN.CloseCN.ConnectionString="Provider=Microsoft.Je...
Private Sub Form_Load()
If CN.State Then CN.Close
CN.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\database.mdb;Persist Security Info=False"
CN.Open
miCount = 0
Ok = False
txtUserName.Text = GetSetting(App.Title, "Settings", "user_name", "")
End Sub
啥意思?怎么陈述? 展开
If CN.State Then CN.Close
CN.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\database.mdb;Persist Security Info=False"
CN.Open
miCount = 0
Ok = False
txtUserName.Text = GetSetting(App.Title, "Settings", "user_name", "")
End Sub
啥意思?怎么陈述? 展开
1个回答
展开全部
Private Sub Form_Load()
If CN.State Then CN.Close
如果CN打开了则关闭
CN.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\database.mdb;Persist Security Info=False"
声明数据库的类型及数据库位置和名称
CN.Open
打开CN
miCount = 0
计算数置零
Ok = False
OK置否
txtUserName.Text = GetSetting(App.Title, "Settings", "user_name", "")
用户名文本框值设为注册表中的用户名
End Sub
If CN.State Then CN.Close
如果CN打开了则关闭
CN.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\database.mdb;Persist Security Info=False"
声明数据库的类型及数据库位置和名称
CN.Open
打开CN
miCount = 0
计算数置零
Ok = False
OK置否
txtUserName.Text = GetSetting(App.Title, "Settings", "user_name", "")
用户名文本框值设为注册表中的用户名
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询