M
Mark Wickett
I'm writing a select query that references a SQL Server table through linked
ODBC. Each record in the table has a "Parent" ID that refers to another
record in the same table (sometimes the same record). Some records have
parents of parents, but there are no more iterations.
The query links the ID to its Parent, then again to the Parent of the Parent
- the (simplified) SQL is this:
SELECT dbo_V.V_ID, dbo_VCH.Channel, dbo_V_2.Name
FROM ((dbo_V LEFT JOIN dbo_V AS dbo_V_1 ON dbo_V.ParentID = dbo_V_1.ID) LEFT
JOIN dbo_V AS dbo_V_2 ON dbo_V_1.ParentID = dbo_V_2.ID) LEFT JOIN dbo_VCH ON
dbo_V_2.ParentID = dbo_VCH.ID;
This works fine on its own.
I have a second query that matches another table (internal to Access) on
"ID" to return "Name" and every time I run it, I get "Invalid operation",
then clicking "Help" returns "Error 3219" and a list of possible reasons -
none of which seem to apply.
If I do a MAKETABLE on the first query and then use the resultant table to
link to in the second query, it all works fine.
I don't get why the table works when the query doesn't!
Regards,
Mark
ODBC. Each record in the table has a "Parent" ID that refers to another
record in the same table (sometimes the same record). Some records have
parents of parents, but there are no more iterations.
The query links the ID to its Parent, then again to the Parent of the Parent
- the (simplified) SQL is this:
SELECT dbo_V.V_ID, dbo_VCH.Channel, dbo_V_2.Name
FROM ((dbo_V LEFT JOIN dbo_V AS dbo_V_1 ON dbo_V.ParentID = dbo_V_1.ID) LEFT
JOIN dbo_V AS dbo_V_2 ON dbo_V_1.ParentID = dbo_V_2.ID) LEFT JOIN dbo_VCH ON
dbo_V_2.ParentID = dbo_VCH.ID;
This works fine on its own.
I have a second query that matches another table (internal to Access) on
"ID" to return "Name" and every time I run it, I get "Invalid operation",
then clicking "Help" returns "Error 3219" and a list of possible reasons -
none of which seem to apply.
If I do a MAKETABLE on the first query and then use the resultant table to
link to in the second query, it all works fine.
I don't get why the table works when the query doesn't!
Regards,
Mark