Skip to content

pyaccesskit.options

pyaccesskit.options

Session options (how PyAccessKit starts and supervises Microsoft Access).

SessionOptions dataclass

SessionOptions(
    visible: bool = False,
    macro_security: MacroSecurity = MacroSecurity.DISABLE,
    dialog_policy: DialogPolicy = DialogPolicy.FAIL,
    call_timeout: float | None = 600.0,
    quit_timeout: float = 30.0,
    kill_on_parent_exit: bool = True,
    access_progid: str = "Access.Application",
    apply_native_defaults: bool = True,
)

Advanced settings for a database session. The defaults are right for build scripts.

Attributes:

Name Type Description
visible bool

Show the Access window (useful for debugging). Dialog detection then only considers standard dialog windows.

macro_security MacroSecurity

What Access may run when it opens a database as its current database. The default, DISABLE, never runs AutoExec macros, startup-form code or VBA — whatever the user's Trust Center says.

dialog_policy DialogPolicy

What to do when Access shows a modal dialog during an automated call.

call_timeout float | None

Seconds one operation may take before the owned Access process is terminated (None = no limit).

quit_timeout float

Seconds to wait for Access to exit after Quit before terminating it.

kill_on_parent_exit bool

Put Access in a Windows job object so it dies with this Python process.

access_progid str

ProgID used to start Access (e.g. "Access.Application.16" on multi-version machines).

apply_native_defaults bool

When DAO creates a database, add the properties Access itself writes to new databases (tabbed documents, themed controls...), so the result matches engine="access".