Discussion:
Error in FROM clause (MS Access)
(too old to reply)
ajdklfajdlk
2006-07-12 04:53:44 UTC
Permalink
I'm getting an 'error executing a database query.' The query is a simple

<cfquery name="myquery" datasource="#application.dsn#">
SELECT *
FROM #url.table#
</cfquery>

The debugging info i get is as follows:
SELECT * FROM Order
VENDORERRORCODE -3506
SQLSTATE 42000

It also states the error is in the FROM clause and only happens when url.table
is Order, not the other table names. I know the order table exists because i
get a nonexistent table name error when url table is a bogus table name. This
implies that
it knows the order table exists but says there's an error in the FROM clause.
The query is successful on all the other tables in my db (MS access, i'm using
the access driver without unicode). Any ideas?
Mountain Lover
2006-07-12 05:03:16 UTC
Permalink
order is a reserved word...you'll need to escape it using brackets
FROM [order]
HTH
--
Tim Carley
www.recfusion.com
***@NOSPAMINGrecfusion.com
Loading...