Board index » delphi » TQuery: Table does not exist LIES!

TQuery: Table does not exist LIES!

Hi World,

I'm trying to build "Query-by-example" functionality into
my Delphi programs. I'm basically going to use a TQuery
object, and build the SQL property myself. BUT:

I'm getting "Table does not exist" errors when creating a
TQuery object with the "RequestLive" property set to True,
when talking via ODBC to an Informix Database - it works
fine against the local Interbase Engine.

There is no error when "RequestLive" is set to False.

The SQL property is simply "select * from stock" which should
certainly conform to Local SQL syntax!!

Anybody else experienced this problem?
Where do I start to look?
Is there a better way to implement "Query-by-example"?

Thanks
Kerry Sainsbury

PS: comp.lang.pascal.delphi.databases hasn't made it here yet!

 

Re:TQuery: Table does not exist LIES!


In article <10795248.9264.25...@kcbbs.gen.nz>, ke...@kcbbs.gen.nz
says...

Quote

>Hi World,

>I'm trying to build "Query-by-example" functionality into
>my Delphi programs. I'm basically going to use a TQuery
>object, and build the SQL property myself. BUT:

>I'm getting "Table does not exist" errors when creating a
>TQuery object with the "RequestLive" property set to True,
>when talking via ODBC to an Informix Database - it works
>fine against the local Interbase Engine.

>There is no error when "RequestLive" is set to False.

>The SQL property is simply "select * from stock" which should
>certainly conform to Local SQL syntax!!

>Anybody else experienced this problem?
>Where do I start to look?
>Is there a better way to implement "Query-by-example"?

>Thanks
>Kerry Sainsbury

This error is very easy to get with ODBC if your table names are longer than
a single word.  The BDE does not recognize that the table name is more
than one word, and subsequently tries to open a table that is named only
half of the actual name.  I discovered this problem when trying to connect to
Access tables.  Big oversight, IMHO.

I don't know if this is your particular problem, but maybe so.  And for all the
others out there, they now have a heads up.  Good luck.

Todd
--
=======================================================
Todd Fast (that's right...just like the adjective)    tf...@eden.com
"His mind is somewhat too much taken up with his mind." - John Earle
=======================================================

Re:TQuery: Table does not exist LIES!


In article <10795248.9264.25...@kcbbs.gen.nz>, ke...@kcbbs.gen.nz
says...

Quote
>I'm getting "Table does not exist" errors when creating a
>TQuery object with the "RequestLive" property set to True,
>when talking via ODBC to an Informix Database - it works
>fine against the local Interbase Engine.

>There is no error when "RequestLive" is set to False.

>The SQL property is simply "select * from stock" which should
>certainly conform to Local SQL syntax!!

Here's the solution, in case anybody wants to stick it into the FAQ:

select * from 'owner.table'      - When "RequestLive" is True
select * from owner.table        - When "RequestLive" is False

These are mutually exclusive. You can't have quotes and "RequestLive" False,
nor no-quotes and "RequestLive" True.

This is via ODBC connecting to Informix Database engines. There is no such
problem when talking to Interbase, or Access via ODBC.

Regards,
Kerry S   (slowly regaining his sanity after tracking this problem down!)
------------------------------------,------------------------------------------
Kerry Sainsbury, ke...@kcbbs.gen.nz |      THE INFORMIX FAQ v2.2 Mar 95
Quanta Systems, Auckland            | kcbbs.gen.nz:/informix/informix.[faq|apx]
New Zealand. Work: +64 9 377-4473   | mathcs.emory.edu:/pub/informix/faq/ " "
             Home: +64 9 279-3571   | http://www.garpac.com/informix.html

Other Threads