G
Guest
We have an Access 97 mdb. It has several linked tables to real tables in a
MS SQL Server 7. It worked fine up until a month ago. Now after we refresh
its linked tables we are getting the following error:
[Microsoft][ODBC SQL Server Driver][SQL Server] The column prefix
'dbo.a_qkit' does not match a table name or alias name used in the query.
(#107)
If we take the old mdb and execute the query it works just fine.
If we take the new mdb it reports this error. All this with the same
machine, same database, same database server, etc. The only change we are
making it is just refreshing the links. The tables' structure has not
changed since they were linked for the last time.
The query is a multi-join with two left joins as follows:
SELECT qmatejec.idmatejec, qmatejec.idejec, qmatejec.idmaterial,
articulos.nombre, qmatejec.unidades, qmaterial.reutilizable,
qkitejec.idkitejec, qkitejec.idkit, qmatejec.enlaceifactur, qkit.descripcion
FROM ((articulos INNER JOIN (qmatejec INNER JOIN qmaterial ON
qmatejec.idmaterial = qmaterial.codigo) ON (articulos.familia =
qmaterial.familia) AND (articulos.grupo = qmaterial.grupo) AND
(articulos.subgrupo = qmaterial.subgrupo)) LEFT JOIN qkitejec ON
qmatejec.idkitejec = qkitejec.idkitejec) LEFT JOIN qkit ON qkitejec.idkit =
qkit.codigo where qmatejec.idejec=149 ORDER BY
qkitejec.idkitejec,qmaterial.descripcion
We did an ODBC trace and this is what's happening:
WHEN IT WORKS:
Access makes a select of the table a_qkit (which is the real name for the
qkit alias used in the query) and then executes a select statement with no
reference to this table, making what we guess is a local-join.
WHEN IT DOESN'T WORK
Access sends a query to the server that it does not have the "a_qkit" table
in the from clause but it is being used as a condition for the join. It's
splitting the select incorrectly, leaving part of the statemet that should
not be there!
Any clues as what may be happening?
Does anyone know if refreshing links does update the info Access has about
the table's data distribution or number of rows, that will make the jet
engine change its mind about the optimal way to execute queries? Is this
info kept in the mdb a all?
MS SQL Server 7. It worked fine up until a month ago. Now after we refresh
its linked tables we are getting the following error:
[Microsoft][ODBC SQL Server Driver][SQL Server] The column prefix
'dbo.a_qkit' does not match a table name or alias name used in the query.
(#107)
If we take the old mdb and execute the query it works just fine.
If we take the new mdb it reports this error. All this with the same
machine, same database, same database server, etc. The only change we are
making it is just refreshing the links. The tables' structure has not
changed since they were linked for the last time.
The query is a multi-join with two left joins as follows:
SELECT qmatejec.idmatejec, qmatejec.idejec, qmatejec.idmaterial,
articulos.nombre, qmatejec.unidades, qmaterial.reutilizable,
qkitejec.idkitejec, qkitejec.idkit, qmatejec.enlaceifactur, qkit.descripcion
FROM ((articulos INNER JOIN (qmatejec INNER JOIN qmaterial ON
qmatejec.idmaterial = qmaterial.codigo) ON (articulos.familia =
qmaterial.familia) AND (articulos.grupo = qmaterial.grupo) AND
(articulos.subgrupo = qmaterial.subgrupo)) LEFT JOIN qkitejec ON
qmatejec.idkitejec = qkitejec.idkitejec) LEFT JOIN qkit ON qkitejec.idkit =
qkit.codigo where qmatejec.idejec=149 ORDER BY
qkitejec.idkitejec,qmaterial.descripcion
We did an ODBC trace and this is what's happening:
WHEN IT WORKS:
Access makes a select of the table a_qkit (which is the real name for the
qkit alias used in the query) and then executes a select statement with no
reference to this table, making what we guess is a local-join.
WHEN IT DOESN'T WORK
Access sends a query to the server that it does not have the "a_qkit" table
in the from clause but it is being used as a condition for the join. It's
splitting the select incorrectly, leaving part of the statemet that should
not be there!
Any clues as what may be happening?
Does anyone know if refreshing links does update the info Access has about
the table's data distribution or number of rows, that will make the jet
engine change its mind about the optimal way to execute queries? Is this
info kept in the mdb a all?