Skip to main content
May 28, 2009
Question

Can not find query in MS ACCESS

  • May 28, 2009
  • 1 reply
  • 1568 views

I have a strange problem.

In a MS ACCESS database I have a table with the name POST

In my .cfm I have

<CFIF IsDefined("reactie")>

<CFQUERY NAME="Adressen" DATASOURCE=diversen">

SELECT * FROM post_invoer

WHERE publi LIKE '%#reactie#%'

ORDER BY discussieID desc

</CFQUERY>

and then the output.

It works fine.

But now I made in the MS ACCESS database a query that is exactly the same as the table, but ofcourse with another name.

<CFIF IsDefined("reactie")>

<CFQUERY NAME="Adressen" DATASOURCE=diversen">

SELECT * FROM postvip

WHERE publi LIKE '%#reactie#%'

ORDER BY discussieID desc

</CFQUERY>

I get this error

------------------------------------------------------------------------------------------

Error Executing Database Query. 

Failed to find table postvip in database diversen 

 

The error occurred in \\NAWINFS03\home\..................................: line 45

43 : <CFQUERY NAME="Adressen" DATASOURCE="Dordtnl_diversen">

44 : SELECT * FROM postvip

45 : WHERE publi LIKE '#reactie#%'

46 : ORDER BY discussieID desc

47 : </CFQUERY>

--------------------------------------------------------------------------------

SQL    SELECT * FROM postvip WHERE publi LIKE '%' ORDER BY discussieID desc 

DATASOURCE   Dordtnl_diversen

VENDORERRORCODE   212992

SQLSTATE   34000

The error says that there is not a TABLE postvip. I know, there is a QUERY with that name. Why can CF not find the query?

Who can help me?

Greetings from Holland.

JesP

This topic has been closed for replies.

1 reply

Participating Frequently
May 28, 2009

You need to specify dbtype="query" in order to use Query of Queries

(which appears you're attempting to do if you want to select from a

previously made query postvip):


]]>

Mack

May 28, 2009

Sorry, but  it doesn't work. I still get the error

Error Executing Database Query. 
Failed to find table postvip in database diversen 
 
The error occurred in \\NAWINFS03\home\users\ ........... .........: line 45


43 : <CFQUERY NAME="Adressen" DATASOURCE="Dordtnl_diversen" dbtype="query">
44 : SELECT * FROM postvip
45 : WHERE publi LIKE '#reactie#'
46 : ORDER BY discussieID desc
47 : </CFQUERY>

--------------------------------------------------------------------------------

SQL    SELECT * FROM postvip WHERE publi LIKE '%' ORDER BY discussieID desc 
DATASOURCE   Dordtnl_diversen
VENDORERRORCODE   212992
SQLSTATE   34000

Participating Frequently
May 28, 2009

I'm confused. You're trying to select from a table or from a query ?

Mack