Startup options via VBA

O

OceanView

Hi folks,
Is is possible to access the "startup" and "database options"
settings programmatically? For example, I need to know if the "allow
special keys" option is checked or not, and to access the
"application_version" (user-defined) setting in the database options
screen.

Are these store in the database itself and saved in the registry?
Assistance appreciated. Thanks!
 
R

Rebecca Riordan

You can use the GetOptions method of the Application object.

HTH

--
Rebecca Riordan, MVP

Designing Relational Database Systems
Microsoft SQL Server 2000 Programming Step by Step
Microsoft ADO.NET Step by Step

http://www.microsoft.com/mspress

Blessed are they who can laugh at themselves,
for they shall never cease to be amused...
 
D

Dirk Goldgar

OceanView said:
Hi folks,
Is is possible to access the "startup" and "database options"
settings programmatically? For example, I need to know if the "allow
special keys" option is checked or not, and to access the
"application_version" (user-defined) setting in the database options
screen.

Are these store in the database itself and saved in the registry?
Assistance appreciated. Thanks!

These are stored in the database itself, but in different locations.
Code like this can reveal them:

Dim db As DAO.Database
Dim blnSpecialKeys As Boolean
Dim dblAppVersion As Double

Set db = CurrentDb

On Error Resume Next ' ignore error if properties don't exist
blnSpecialKeys = db.Properties("AllowSpecialKeys")
dblAppVersion =
db.Containers("Databases").Documents("UserDefined").Properties("applicat
ion_version")

Set db = Nothing

Note that I assumed that your user-defined property
"application_version" is numeric.
 
O

OceanView

Dim db As DAO.Database
Dim blnSpecialKeys As Boolean
Dim dblAppVersion As Double

Set db = CurrentDb

On Error Resume Next ' ignore error if properties don't
exist blnSpecialKeys = db.Properties("AllowSpecialKeys")
dblAppVersion =
db.Containers("Databases").Documents("UserDefined").Properties("a
pplicat ion_version")

Set db = Nothing

Worked well. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top