What is tcp.mdx?
tcp.mdx is a file that stores a compiled Microsoft Access query. The “tcp” part is simply the name given to the query when it was created, and the “.mdx” extension tells Windows that the file contains a pre‑processed (compiled) version of that query. When Access runs the query, it can load the .mdx file instead of re‑parsing the original SQL each time, which makes the query run faster.
Let's break it down
- tcp - the identifier you (or the developer) chose for the query; it could be anything like “sales_report” or “customer_list”.
- .mdx - short for “Microsoft Data eXecutable”. It indicates a compiled query file used by Microsoft Access (and sometimes by other Office applications).
- Compiled query - Access takes the SQL you wrote, translates it into an internal format, and saves that translation in the .mdx file. The next time the query runs, Access reads the compiled version instead of re‑interpreting the SQL text.
Why does it matter?
Compiled queries speed up database operations. By using tcp.mdx, Access can skip the step of parsing and optimizing the SQL each time, which reduces CPU usage and shortens response time-especially important for large tables or complex joins. It also helps protect the original SQL text, because the .mdx file contains only the compiled version.
Where is it used?
- In Microsoft Access databases that contain saved queries.
- In shared Access applications where multiple users run the same query; the .mdx file lives in the same folder as the .mdb or .accdb file.
- Occasionally in other Office tools (like Excel) that link to an Access query and rely on the compiled version for faster refreshes.
Good things about it
- Performance boost - faster query execution after the first run.
- Reduced parsing errors - once compiled, the query is less likely to break due to syntax changes.
- Portability - the .mdx file travels with the database, so other users get the same optimized query without needing to re‑compile.
- Security - the original SQL text isn’t exposed directly, offering a tiny layer of obscurity.
Not-so-good things
- Stale cache - if the underlying table structure changes (fields added/removed), the .mdx file can become outdated and cause errors until it’s recompiled.
- Limited visibility - you can’t easily read or edit the query inside the .mdx file; you must open the original query in Access.
- File bloat - each compiled query adds another file to the folder, which can become messy in large projects.
- Compatibility - .mdx files are specific to Microsoft Access; other database systems can’t use them.