You probably need the 64-bit version of LINQPad since you have the 64-bit Access/drivers installed (look for the message Running massive queries in LINQPad 5? on the download page). I'm not sure if it will work with the script I provided with no other changes, as I've never used 64-bit Access and don't have a machine with it installed that I can experiment with.
Thanks
I downloaded the 64-bit version of LINQPad with the following results
Using CC version 2511 19426.20186 64-bit, the script failed on the line var rs = .... with the error Operation is not supported for this type of object
Using Beta version 2601 19611.20002 64-bit .... same error
Rolling back to CC 2509 19231.20216 64-bit . . .success
NOTE: I couldn't find build 19231.20246 - was that another mistake in your post?
Anyway, assuming I've now correctly understood the problem, I'm happy to inform the Access team about the issue tomorrow.
I'll let you know if I get a response.
Awesome glad to hear! Yes this is exactly the issue, appreciate your help in reviewing this. And thanks for your patience sorry for all the posts to get to the explanation. I really hope they plan to fix this but I could understand we are probably well outside of normal usage.
One thing. When the query ran successfully in version 2509, the output in the LINQPad window just showed the number of records (1) but not the actual data. Is that normal?
I agree that this is very unusual usage so it may not be a high priority to fix. If not you will indeed need to find a workaround or freeze updates at version 2509
Anyway I'll email the A-team attaching the repro files and try to explain the issue succinctly
Yes that is just a simple test to demonstrate the issue, so I output the rs.RecordCount value. In the production code we read out all of the recordset fields and rows into objects for processing from many tables, and then insert thousands of rows back into tables at the end in a transaction.
The reason we adopted DAO for all C# processing is because it is orders of magnitude faster than OLEDB, and this is a high-scale performance sensitive usage. Especially when saving records, it can be up to 10x faster to create records with DAO than using INSERT statements over OLEDB. For retrieving records it is 2-3x faster than OLEDB. Also, with DAO we can use workspace transactions for easy rollback across databases, but it is very difficult to do this with OLEDB. It took some effort to build clean and reliable COM wrappers but we have a nearly 100% error-free C# DAO library and would like to keep using it that way for the performance/usability gains.
I am on A365-32 MEC v2510 and I also get the error with the heterogeneous query.
The only way I can make it work is to attach the table from test2.accdb. I realize that would be a massive change to the OP's app, and may not be practical.
Further to my previous post:
The Access team are aware of the issue which was introduced with a security fix on Tues 9 Dec.
They are currently investigating for workarounds, and whether a change could be made to allow cases such as yours.
To use this as a workaround, you need to set the AllowQueryRemoteTables DWORD registry value to 1 so that these queries will be allowed to run. By default, if the key is missing, or set to 0, then queries that have external references in them are blocked unless they are run by Access using a trusted database.
I have tested this registry ‘fix’ using Beta Channel 2601 and the query ran successfully using your LINQPad script when the key value was set to 1. The COM Exception error occurred when it was set to 0
However, be aware that if you use this workaround, you are restoring the previous levels of access to that prior to 9 Dec and therefore increasing potential vulnerability. Your code will run but there is a chance of other malicious code also running.
The Access team also stated that there will be an updated article with more information to follow.
For info, there have also been several other reports of what may be the same issue: