Syntax error in FROM clause

Asked By 200 points N/A Posted on -
qa-featured

Hello,

Looking for some piece of advice about what’s going on here.

I used a pivot table in Excel to connect to a table of the external data in access.

I used Microsoft query to return external data to a worksheet in Microsoft excel and every time I view the returned data and I received the following error message:

Syntax error in FROM clause.

I created a pivot table using external data in query or access database. There are no spaces in the names or other oddities that is why the query is extremely small and very simple. I used the very same and exact database on other computer and did not get the error.

Is there something wrong with my coding or it is just the Microsoft query is not functioning well sometimes.

Thank you.

SHARE
Answered By 0 points N/A #125596

Syntax error in FROM clause

qa-featured

Hi Paul,

That syntax error shows that  you have a table name that is a reserved word or your table name consists of (eg "table 1"). Any words like table, field, date, select, password,level are called reserved words by ADO and OLEDB  by Access for use as a commands or system object. You can see all reserved words by Microsoft Jet database engine which runs in several different modes.

sample lists of reserved words are Absolute, Band, Bit, Both, Cascade, Catalog, Default, Desc, Falase Float4, Else, Except, Execute, Found, From and etc.

The Microsoft Jet database engine runs in several different modes depending whether it is called Microsoft  Access, Data Access Objects, the Microsoft OLE DB Provider or Microsoft Access ODBC driver. It can be run be either ANSI mode or non-ANSI mode.

Don't use these words as names for tables or fields.

To solved the syntax error just rename your offending tables/ fields and adjust your sql statement accordingly. Or if it is not possible, enclose your offending table names with [ ] marks, eg

SELECT field 1

FORM [table]

I hope this will help you solve the problems.

By: Zen

Related Questions