Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pass the password to the backend of a split database 3

Status
Not open for further replies.

vfisher

Programmer
Apr 15, 2002
40
US
I am using Access 97. I have a split database. I don't want any of the users to be able to get into the data (backend) without going thru the front-end. I know I can set a password on the database (back-end), but I don't know how to pass that from the front-end.

Any help is greatly appreciated.

 

If you use Access security on your front end and assign rights to your tables by group, then any user not using the correct mdw file and not belonging to the correct group will not be able to access your back end tables; however you asked about passing passwords.
You will have to open your backend with something like the following code.

Dim Db As Database

Set Db = OpenDatabase("C:\My Documents\MyDB.mdb",True, _
False,";pwd=MyPassword1")

Personally, I think you’re making it harder on yourself.
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
I should also mention you might be able to this very easily using a command line parameter. See the password option below. it may be enough to solve your problem.

I still think you would be better off using Access security.

Startup command-line options
The following table lists the Microsoft Access command-line options.
Option Effect
database Opens the specified Microsoft Access database or Microsoft Access project. Include a path if necessary. If you are running Microsoft Windows 95, the default path is your My Documents folder.
/excl Opens the specified Access database for exclusive access. To open the database for shared access in a multiuser environment, omit this option. Applies to Access databases only.
/ro Opens the specified Access database or Access project for read-only access.
/user user name Starts Access by using the specified user name. Applies to Access databases only.
/pwd password Starts Access by using the specified password. Applies to Access databases only.
/profile user profile Starts Access by using the options in the specified user profile instead of the standard Windows Registry settings created when you installed Microsoft Access. This replaces the /ini option used in versions of Microsoft Access prior to Access 97 to specify an initialization file.
/compact target database or target Access project Compacts and repairs the Access database, or compacts the Access project that was specified before the /compact option, and then closes Access. If you omit a target file name following the /compact option, the file is compacted to the original name and folder. To compact to a different name, specify a target file. If you don't include a path in target database or target Access project, the target file is created in your My Documents folder by default.
In an Access project, this option compacts the Access project (.adp) file but not the Microsoft SQL Server database.
/repair Repairs the Access database that was specified before the /repair option, and then closes Microsoft Access. In Microsoft Access 2000 or later, compact and repair functionality is combined under /compact. The /repair option is supported for backward compatibility.
/convert target database Converts a previous-version Access database or Access project to the default file format, renames the new file, and then closes Access. You must specify the source database before you use the /convert option. To view the default file format, click Options on the Tools menu, and then click the Advanced tab.
/x macro Starts Access and runs the specified macro. Another way to run a macro when you open a database is to use an AutoExec macro.
/cmd Specifies that what follows on the command line is the value that will be returned by the Command function. This option must be the last option on the command line. You can use a semicolon (;) as an alternative to /cmd.
Use this option to specify a command-line argument that can be used in Visual Basic code.

/nostartup Starts Access without displaying the task pane (the second dialog box that you see when you start Access).
/wrkgrp workgroup
information file Starts Access by using the specified workgroup information file. Applies to Access databases only.
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Simple,
Add the password to the backend DB.
Open the front end and delete all the links to the backend.
Re link the tables into the frontend, it will ask you the password, enter it and it will remember it from then on.
 
Ecca,

Your post was exactly what I was looking for. Simple and straightforward. Thanks.

Startup
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top