Different Setups For Access 97 (Creating Custom profiles)
Question
Currently I use Access V2, but will shortly change to 97. In V2, I have a number of program manager items for starting Access
using different .INI files. This allows me to load different libraries, have different title bar texts, load different add-ins
etc. to suit the development work in progress.
How is this achieved in 97? I guess some manipulation of the registry is required, but I'm not sure what at this stage.
Answer
From: Shamil Salakhetdinov <shamil@marta.darts.spb.ru>
To: Microsoft Access Database Discussion List <ACCESS-L@PEACH.EASE.LSOFT.COM>
Subject: Re: Different Setups For Access 97
Date: 8 October 1997 22:31
Kim,
Look through MS Access 97's Online Help topic "Create a user profile" (see below) and
do exactly as described in it - I did and I succesfully created several profiles (installations) of my
app. Of course this process can be automated... And there is no need to follow exactly all the
steps described in online help...
HTH,
Shamil
P.S. How to create a user profile:
To create a user profile:
- Start the Registry Editor.
- Navigate to the \HKEY_LOCAL_MACHINE\SOFTWARE key.
- Add three nested keys using the following format to ensure uniqueness:
\Your Company\Your Application\Your Application Version Number
- Under the \Your Application Version Number key, re-create any of the keys located under the
\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\8.0\Access key that contain values that you want to modify (except the
\Profiles key you will create in step 7), and then copy the appropriate values under each key.
- Modify the values that you want to change.
- Navigate to the \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\8.0\Access key.
- Add a new key and name it \Profiles.
- Add a string value to the \Profiles key and give it the name that you want to use on the command-line.
- For the value's data, enter a string that points to the location of the keys created in step 3: \SOFTWARE\Your
Company\Your Application\Your Application Version Number.
- Create a command-line for your application that specifies the name you entered in step 8, in double (") quotation
marks. For example: MSAccess.exe /profile "Your Profile" Your Application.mdb
To override any of the Jet 3.5 database engine default settings
- Navigate to the \HKEY_LOCAL_MACHINE\SOFTWARE\Your Company\Your Application\Your Application Version Number profile
key.
- Create a key named \Jet\3.5\Engines.
- For each built-in driver's settings you want to override:
* Add an appropriately named key below the key created in step 2, for example, to override Jet Paradox settings, add a
key named "Paradox."
* Add values of the appropriate name and type to that key, and then specify the settings.
You can model your keys and values after the keys and values in \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\3.5\Engines.
Notes
- You can use the acSysCmdProfile argument of the SysCmd function to determine if your application has properly loaded
your user profile (For example, your users might accidentally open your application through Windows Explorer and bypass
the /profile command-line option). For more information click.
- You can also use the Data Access Object (DAO) method, DBEngine.SetOption to dynamically modify Jet registry values at
run-time for a single session, without permanently modifying the values in the Windows Registry. For more information,
click.
- It's possible to have the same registry key set in three different ways, but only one value can be used. In a case
like this, a user profile setting takes precedence over a Microsoft Access setting, which in turn takes precedence over
a Microsoft Jet setting. The following table illustrates this order of precedence using the ODBC ConnectionTimeout
setting as an example.
|
Order |
Location |
Registry setting under \HKEY_LOCAL_MACHINE\SOFTWARE? |
|
1 |
user profile |
\Your Company\Your Application\Your Application Version
Number\ODBC\ConnectionTimeout=100 |
|
2 |
Microsoft Access |
\Microsoft\Office\8.0\Access\Jet\3.5\Engines
\ODBC\ConnectionTimeout=300 |
|
3 |
Microsoft Jet |
\Microsoft\Jet\3.5\Engines\ODBC\ConnectionTimeout=600 |
If you start your application using a command-line that specifies the user profile, then Microsoft Access uses the
ConnectionTimeout value of 100. If you start your application without using the user profile, then Microsoft Access
uses the ConnectionTimeout value of 300.