
HELP: Access 2.0/VB3 db Security
: How do I protect an MS Access 2.0 database being used in a VB3 app so
: that
: (1) user with Access on their workstations cannot open the database
: unless they have a login name and password and,
: (2) the application can pass a login or password to the database so the
: app can alter the data?
:
: I'd like to simply create two accounts for the database, one for outside
: administrative access and one for the application. Otherwise, a generic
: user of Access should be barred from opening or modifying the database.
Set up security (take a look at the Access Security Whitepaper in the Access
Knowledgebase) in the database.
In your VB program:
Global wrk As Workspace
In your startup procedure (Form_Load or Sub Main), just before you open the
database:
DBEngine.IniPath = "MYAPP.INI"
' This is the INI file that references your SYSTEM.MDA file
Set wrk = DBEngine.CreateWorkspace("WorkSpaceName","UserName","Password")
replace your database opening command with something like this(basically,
use the OpenDatabase method of the workspace you just created):
Set dbWhatever = wrk.OpenDatabase("MYDB.MDB")
This will cause MYDB.MDB to be opened with user UserName and password
Password instead of user Admin with no password.
Eric Rossing
Intec Company, Inc.