Skip to main content
Inspiring
July 12, 2006
Answered

Error in FROM clause (MS Access)

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?
This topic is closed to new replies. Start a new post to keep the conversation going.
Newsgroup_UserCorrect answer
Inspiring
July 12, 2006
order is a reserved word...you'll need to escape it using brackets
FROM [order]
HTH
--
Tim Carley
www.recfusion.com
info@NOSPAMINGrecfusion.com

1 reply

Newsgroup_UserCorrect answer
Inspiring
July 12, 2006
order is a reserved word...you'll need to escape it using brackets
FROM [order]
HTH
--
Tim Carley
www.recfusion.com
info@NOSPAMINGrecfusion.com
Translate