Skip to content
Auscultby NBIT
EN
Free diagnostic

In depth · Security

Securing an Access application: what to check

An Access application is not a safe: it is a file that can be copied in a second. Its security rests on a handful of choices, often made long ago and rarely revisited. These are the ones to check first.

A chain and padlock securing a door

Access was designed to let a team build an effective tool quickly, not to withstand a determined attacker. That does not make every Access application dangerous: many are reasonably safe because their file sits in the right place, their passwords are not lying around in the code and their backups exist. But when these points have never been checked, any incident becomes a data leak: a stolen laptop, a copy sent by mistake, a former employee who kept a copy of the file.

The checks below do not require security expertise. They require opening the application and looking in the right places.

1. Passwords written in plain text

This is the most common flaw and the most serious. It turns up in three places:

These points are part of the risks reported before a migration: better to know them before deciding what comes next.

  • In the VBA code: a constant or string holding the password for a server, a mailbox, a website or another database. Anyone who opens the VBA editor can read it.
  • In linked tables: when a table is linked to SQL Server or another ODBC source with the "Save password" option, the full connection string, "PWD=" included, is stored in the file. It remains readable by anyone who knows where to look, even if nobody ever typed it into the code.
  • In a users table: many applications manage their own accounts, with a "Password" field stored as text. Anyone can open the table and read their colleagues' passwords, often the same ones they use for email.

A password found in plain text must be treated as compromised: change it on the server, not just in the file, since older copies of the application may still be in circulation.

2. Queries built by pasting user input

Many applications build their queries by assembling text: the start of the query, then whatever the user just typed, wrapped in quotes. The first symptom is mundane: a search for "O'Brien" or "L'Oréal" raises a syntax error. The second is less so: carefully crafted input can change what the query does, for example to get past a login form without a password.

The same search written two ways.
Value pasted into the SQLParameterised query
sql = "SELECT * FROM Customers WHERE Name = '" & Me.txtName & "'"Set q = db.CreateQueryDef("", "PARAMETERS pName Text; SELECT * FROM Customers WHERE Name = pName") then q!pName = Me.txtName
Input “O'Brien”: WHERE Name = 'O'Brien' → syntax error 3075Input “O'Brien”: the value stays a value
Crafted input can change what the query doesApostrophes and crafted input no longer affect the query

The fix is well known: parameterised queries (a QueryDef and its Parameters) or, failing that, systematically doubling the quotes in pasted values. It is substantial work when an application has dozens of such queries, so start with those that touch passwords and deletions.

A bunch of keys

3. The file itself: encryption and ACCDE

Two file-level protections are often confused:

ProtectionWhat it protectsWhat it does not protect
Encryption with a password (File > Info, database opened exclusively)The data: without the password, a copied file is unreadableUse by someone who knows the password; a password shared by the whole team
Compiled ACCDE version (File > Save As)The code: the VBA source is removed and forms and reports can no longer be editedThe data in the tables, still readable
File location and NTFS permissionsWho can open, copy or replace the fileWhat an authorised person does once the file is open

An ACCDE should always be kept alongside its source version (ACCDB), stored separately: without it, no further changes are possible. And an encryption password is only worth something if it is not written into the code of another database that opens this one automatically, which happens more often than you might think.

4. Macros blocked in files from the internet

Since 2022, Microsoft has changed Office's default behaviour: VBA macros in files that come from the internet are blocked, and the user sees a "Security risk" banner with no button to enable content. Access is among the affected applications, along with Excel, Word, PowerPoint, Project, Publisher and Visio. The change started rolling out on 27 July 2022 in Current Channel (version 2206) of Microsoft 365, then reached the other channels by January 2023.

Windows tags downloaded files and email attachments with a "Mark of the Web". An Access application emailed to a new colleague, or downloaded from a website, therefore arrives with its code disabled. Microsoft also notes that files on a network share can be treated as coming from the internet, for example when the share is addressed by its IP address.

Microsoft's recommended responses, from the most targeted to the broadest:

  1. For a single file whose origin you know: remove the mark (file Properties > Unblock, or the PowerShell command Unblock-File).
  2. For an application distributed regularly: sign the code with a certificate and add the publisher as trusted.
  3. For a folder on the PC: declare it a trusted location in the Trust Center, sparingly.
  4. For an internal share: place it in the Local intranet or Trusted sites zone through Group Policy, while controlling who can drop files there.

A trusted location is not a trivial setting: any file placed there opens with its macros enabled. A trusted network folder that everyone can write to amounts to switching the protection off. Microsoft generally advises against declaring network locations as trusted.

5. Personal data and where it lives

An Access application often holds far more personal data than people realise: contact details, dates of birth, national insurance or social security numbers, health or payroll information. Its presence is not a problem in itself; its exposure is. The questions are simple: where is the file, who can copy it, is it encrypted, are there copies on PCs or USB sticks? Our guide Access databases and GDPR covers these points in detail.

6. Backups, the last line of defence

A backup is not a spectacular security measure, but it is the one that saves the business after ransomware, corruption or an unfortunate deletion. For an Access application, it must follow three rules:

  • copy the file when nobody is using it, otherwise the copy may be inconsistent;
  • keep several generations, so you can go back to before an incident discovered late;
  • test a restore from time to time: open the copy and check that it contains recent data.

Backups contain the data too: they deserve the same protection as the original file.

The one-page checklist

  • No plain-text passwords in the code, ODBC links or any table.
  • Queries that touch accounts and deletions are parameterised.
  • The file is encrypted if it holds sensitive data, and stored in a folder with controlled permissions.
  • The distributed version is an ACCDE; the source is kept separately.
  • Macros run thanks to a signature or a controlled location, not an "enable everything" setting.
  • Backups exist, there are several of them, and at least one has been restored.

Personal data hidden in tables is covered in Access databases and GDPR.

Sources

All articles

What about your application?

The diagnostic runs on your computer, without sending the contents of your tables. The summary is free.