top of page

Query Reference to Remote Database Fails

Updated: 6 days ago


Description

You get an error message with a query or SQL text that refers to a remote Access database, e.g. using an IN clause: SELECT * FROM Table1 IN 'd:\Foo\Some.accdb' or direct notation: SELECT * FROM [d:\Foo\Some.accdb].[Table1]


The most common error message is: "Operation is not supported for this type of object." If you try to run the query/SQL from VBA, this is runtime error 3251. The problem can happen within Access or in a different program like Excel that tries to get data from an Access database. Some forum discussions:


Microsoft Q&A

Stackoverflow

AWF


Cause

Microsoft has increased the security measures with regard to the execution of queries in remote databases. An optional registry key for this was already introduced in 2021 with KB5002984. The Office security updates from December 9, 2025, changed the default to block the execution even if the registry key doesn't exist.


Status

From Microsoft's point of view, this is not a bug but a security feature. Therefore, the only solutions available are the workarounds listed below.


A solution for a particular situation is available as of version 2601 build 19628.2015, released on Jan 27, 2026. However, it only solves the case where there is already a connection to an Access database and the same database is used again in an IN clause. This type of use, which in practice may e.g. occur in Excel, no longer throws error 3251 with the fix.


Workaround 1

If the problem occurs in a different program than Access, then check whether the registry key described in KB5002984 exists on your system and has the value 0 (=block). If so, you can set it to 1 to allow remote execution of queries from outside of Access. If the key does not exist, you can create it and set it to 1, as described in the KB article.


Workaround 2

If the problem occurs from within Access, it helps to declare the database with the external reference as Trusted (or set "Allow all macros").


Workaround 3

Especially if you do not have the permissions for the other workarounds:

Another method to avoid the reference to remote databases in Access queries/SQL is to use linked tables. So instead of using a SQL text like mentioned in the Description section above, you can create a link to Table1 in d:\Foo\Some.accdb, and then use the local linked table in your query or statement: SELECT * FROM Table1

If you need to reference different tables dynamically you can create or modify the link with VBA code using methods like TransferDatabase and RefreshLink.


Workaround 4

A temporary remedy is to roll back to an older build of Office/Access in which the problem does not yet occur, i.e. to 19426.20170 of Dec 3 or earlier.



If you encounter a variation of this problem, feel free to describe your specific issue in a comment on this article so that we can inform Microsoft about it.

bottom of page