I'm attempting to build a tool that pulls information from a database containing financial information, but I've hit a wall with this problem. The following query would give me some of the data I require, but as soon as I add in the sub-query, I get the error message
"ODBC--call failed".
If I replace the sub-query with a static "WHERE TRAN_NUMBER IN (0,1,2,3..)"
it returns the expected values. The sub-query returns the expected values when run by itself.
I'm using MS Access and C# and the OleDB library to do this
Any Ideas what I've done incorrectly?
SELECT NOMINAL_CODE, DETAILS, AMOUNT, TYPE
FROM AUDIT_JOURNAL
WHERE TRAN_NUMBER IN
(SELECT AUDIT_TRAIL_ID
FROM PROJECT_TRAN
WHERE AUDIT_TRAIL_ID > 0);
A first chance exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll
Additional information: ODBC--call failed
Edit: Looks like Subqueries don't work when linked to another database via ODBC (The original database is a SageLine50 database). I've imported the tables statically and it seems to work. Does anyone know how I can make this work without statically importing the tables?