I think that your query is not well formed
for example
FROM (([70_Categories] INNER JOIN [80_Dep_Categ] ...
Should be
FROM ((Select [70_Categories].* FROM [70_Categories]
INNER JOIN [80_Dep_Categ] ...
you must use the square bracked because your table name start with number
70_categories ===> this need [70_Categories]
if your tables named categories_70 you don't need square bracked
Generally you need to use the
square bracked when
1) fieldname or tablename contains space or specialchar [Field 1] or [Field.num]
2) fieldname or tablename starts with number or specialchar [70_categories] or [70 Categories]
I'll give you some advice, to write your query in a more readable and hence easier to verify use this syntax:
dim stmt as String
stmt = $"
SELECT
SQ1.*
FROM (
SELECT
C7.*
,C8.*
FROM [70_Categories] AS C7
INNER JOIN [80_Dep_Categ] AS C8 ON C7.CategoryID = C8.CategoryID
) AS SQ1 /*(subquery1)*/
LEFT JOIN (
SELECT
C6.*
FROM [60_Categories] AS C6
INNER JOIN [90_Dep_Categ] AS C9 ON C9.CategoryID = C6.CategoryID
) AS SQ2 /*(subquery2)*/ ON
SQ2.joincondition = SQ1.JoinCondition
WHERE
SQ1.WhereCondition
AND SQ2.WhereCondition
"$
Declare CR as Cursor
Cr = SQL.ExecQuery(stmt)