如何打开受保护的密码使用visual basic 2008访问数据库 [英] How to open a protected password Access database with visual basic 2008

查看:85
本文介绍了如何打开受保护的密码使用visual basic 2008访问数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



有人帮我打开一个Access数据库(用密码保护)

我在Visual Basic 2008中的应用程序我使用Oledb连接将我的应用程序

链接到数据库。当我的Access数据库没有用密码保护时

我的连接顺利,但我不知道如何在我的应用程序中设置我的数据库密码



我有谷歌搜索,但我找不到对我有用的东西。请帮助! :((



这就是我现在的代码:



 Dim connectiestring As String 
connectiestring =Provider = Microsoft.Jet.OLEDB.4.0; Data Source ='& My.Settings.LocatieDB&'
Dim connectie As New OleDb.OleDbConnection( connectiestring)
Dim SQLcommand As New OleDb.OleDbCommand
connectie.Open()
SQLcommand.Connection = connectie
connectie.Close()

解决方案

这应该回答你的问题

http:/ /support.microsoft.com/kb/191754


您是否尝试在connectiestring的末尾添加; Password = password;?



是否使用数据库级密码或工作组进行保护?如果是工作组,您可能还必须提供用户,因此还要在连接中添加User Id = whatevertheuseridis字符串。

Hello

Can someone help me to open a Access database (protected with a password) in
my application in Visual Basic 2008. I use Oledb connection to link my Application
to the database. When my Access database is not protected with password
my connection goes well, but I don't know how to set my password of my database
in my application.
I have "googled", but I can't find something that works for me. Pleas Help! :((

That's the code that I have at moment:

Dim connectiestring As String
connectiestring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & My.Settings.LocatieDB & "'"
Dim connectie As New OleDb.OleDbConnection(connectiestring)
Dim SQLcommand As New OleDb.OleDbCommand
connectie.Open()
SQLcommand.Connection = connectie
connectie.Close()

解决方案

This should answer your question
http://support.microsoft.com/kb/191754


Have you tried adding ";Password=password;" to the end of your "connectiestring"?

Is it secured with a database level password or a Workgroup? If it is a workgroup you would probably have to provide the user as well so also add "User Id=whatevertheuseridis" to the connection string.


这篇关于如何打开受保护的密码使用visual basic 2008访问数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆