20266 Operation not supported

mellamokb

New member
Local time
Today, 01:09
Joined
Jan 8, 2025
Messages
14
Wasn't sure the best place to ask about this. But we noticed queries of this form:

Select *
From Table1
Inner Join [C:\Data\File.Accdb].Table2 ...

Are now giving an error 'Operation is not supported for this type of object' when running from DAO Database.Open call. It works fine in the Access query UI and worked fine in the previous version. Wondered if anyone else experienced something like this or where is the best place to report the issue?
 
What is the current version and bitness of Access you are on?
What is the previous version where it worked fine?
 
32bit.. I don't know exactly what version I was on before but I'm on the Monthly Channel. On another machine I have 2404 Build 17531.20190 and don't get the error.
 
It does not happen on my Monthly Enterprise Version v2510. I'm asking another tester to try it on his more aggressive versions.
 
At this point I am not convinced that there is a bug. The OP should simplify the problem, and on the failing machine create two new databases with simple names (without any spaces or other funny characters) and put them in a Trusted Location that also is a simple path, and create 2 simple tables, and try again.
 
So, I guess I didn't realize an important detail that mattered. It is specifically the use of DAO via COM interop with a C# script. Apparently this is getting a different result than using DAO via VBA code, which I am surprised to see a difference because I assumed them to be fundamentally identical since both are using COM interop against the same library.

So for example I have two databases, E:\test1.accdb with table tblItem1, and E:\test2.accdb with table tblItem2. Then I run the following C# script (using LINQPad for example, statically linked to Microsoft.Office.Interop.Access.Dao.dll):

var eng = new DBEngine();
var db = eng.OpenDatabase(@"E:\test1.accdb");
var rs = db.OpenRecordset(@"SELECT * FROM tblItem1 INNER JOIN [E:\test2.accdb].tblItem2 ON tblItem1.ID = tblItem2.ID");
rs.Close();
db.Close();
Marshal.ReleaseComObject(rs);
Marshal.ReleaseComObject(db);
Marshal.ReleaseComObject(eng);
rs = null;
db = null;
eng = null;

I also tested the following query and get the same result:

SELECT * FROM tblItem1 INNER JOIN (Select * FROM tblItem2 IN 'E:\test2.accdb') tblItem2 ON tblItem1=tblItem2.ID

We have been using this style of code for almost a year without a single issue before the install of the 20266 release build. Now when I run these queries I get this error on the OpenRecordset call:

COMException - Operation is not supported for this type of object.
 

Users who are viewing this thread

Back
Top Bottom