I'm trying to run a query against 3 different tables in a single database on a linked (Access 97 MDB) server.
I'm attempting to run the query through VB.NET code in a Sub, called from a button click.
The query will error out, however, returning for each table (for however many instances of the table name exsist in the query):
Expand|Select|Wrap|Line Numbers
- Server: Msg 107, Level 16, State 2, Line 1
- The column prefix 'Model' does not match with a table name or alias name used in the query.
code as follows:
Expand|Select|Wrap|Line Numbers
- SELECT DISTINCT Model.TYPE as TYPE, Model.[MODEL_NO] as [MODEL_NO],
- Dealer.Dealer_ID, (Dealer.DNAME) AS DName, (Dealer.DADDRESS1)
- as Address1, (Dealer.DADDRESS2) as Address2, (Dealer.DTOWN)
- as Town, (Dealer.DContry) as Country, (Dealer.MANAGER)
- as Manager, Dealer.[TEL (OFFICE)] as OfficeTel, SerialNo.[SERIAL_NO], Model.[MODEL_ID] FROM CoinsTBL...Model
- INNER JOIN (CoinsTBL...Dealer INNER JOIN CoinsTBL...SerialNo ON
- Dealer.Dealer_ID = SerialNo.[Dealer_ID]) ON Model.[Model_ID] = SerialNo.[Model_ID]
- WHERE (((SerialNo.[SERIAL_NO])=6445));
I can reduce the number of errors returned by removing table references in front of field names, but that also results in 'ambiguos field name' errors in the JOIN statements.
Any ideas why this won't work? If i strip it down into the component table queries, they all work, but it seems when you add them together, something breaks.