'how to open an password protected access mdb file 
Author Message
 'how to open an password protected access mdb file

Here is one way of doing it. I'm opening my databases with code. A lot of
programmers prefer to use a ADO datacontrol, or ADO Dataenvironment. Here is
the code version. This one uses a dataenvironment, but the connectionstring
is set during opening of the database. In other words, the connection
properties is not set in the dataenvironment property pages.

db.conn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;User ID=user;Password=
******;Data Source= " & Location & " ;Persist Security Info=False;Jet
OLEDB:System database=mydatabasedrive\mydatabsepath\mydatabasegroupfile.mdw)
Location is a variable that contains the path to the database file (.mdb
file).

Note:
If you just password protect your database, it'll not be possible to open it
from VB. Now, I may be wrong on that, and anybody that knows better is
welcome to correct me.
Anyway:
The code above opens a database where you have created a group security
file. The connection string needs the "system database" statement if your
group file is not the default group file for Access. The default file is
named "System.mdw" and is usually located in "c:\program files\common
files\system".
If you set your connection properties in the property pages of the
dataenvironment, you'll have to go to the "ALL" tab and set the system
database location there.
If you plan on distributing your application, then you'll need to make a new
groupfile and distribute it along with it. Make sure it is not named
"system.mdw" as it may interfere with the users existing rights when he/she
installs your program.
To create a group file:
Run "C:\Program Files\Microsoft Office\Office\1033\WRKGADM.EXE"
Create a NEW file, and locate it to your app.path.
Then fire up Access and open the database you wanna secure.
Run the "Security-Level Wizard" under the "Tools->Security" menu.
During this session, create an account for yourself.
MAKE SURE THE ACCOUNT IS ASSIGNED TO THE ADMIN GROUP!
Restart Access and open your database.
You'll be propted for username and password.
Enter a username that you created during the security wizard session.
The user account does not have a password yet, so leave it blank.
As soon as you're in, start the "user and group accounts" under
"Tools->Security", and set the password. You can only set password for the
user that is logged in.

That's it. Now you have a secured database, that will open with the code
above.
That was easy. Don't you think :-)

Good luck

Ivar

Quote:

> I am new in vb and don't know how to use vb program to open a password
> protected access mdb file, anybody can tell me or email a sample code .

> thanks in advance



Thu, 15 Jan 2004 09:27:40 GMT  
 'how to open an password protected access mdb file
Under vb4 with Access 97 you could accomplish it like this.

Set databasetoopen = OpenDatabase(pathtodatabaseincludingdatabasename,
False, True, ";UID=admin;PWD=password")

Quote:

> I am new in vb and don't know how to use vb program to open a password
> protected access mdb file, anybody can tell me or email a sample code .

> thanks in advance



Fri, 16 Jan 2004 21:30:36 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. 'how to open an password protected access mdb file

2. 'how to open an password protected access mdb file

3. 'how to open an password protected access mdb file

4. open password protected (.mdb file)

5. accessing a password protected Access Mdb

6. rpt file and password protected mdb file

7. Opening a password protected Access file

8. Opening Access password protected files

9. Problem opening a password protected .MDB

10. Open the password protected MDB with VB

11. Password Protected MDB's and CR8.5

12. Password protected Access.mdb from VB?

 

 
Powered by phpBB® Forum Software