Board index » delphi » The "WHERE" clause and live queries

The "WHERE" clause and live queries

Is the "where" clause an acceptable part of sql syntax that will return a
live result set?  It seems to be for interbase and paradox, but not for SQL
Server.  In an effort to isolate the problem with SQL Server I have set up a
set up a test program entirely within
the form designer; no actual code is involved.  On the form,
I have a TTable, TDataSource, and TQuery component, all set
up properly to access the table I want through a BDE alias that
accesses the remote SQL Server database.  If the TQuery.SQL property is

  select * from master

then it always works, whether the query is live or not.  However,
if the TQuery.SQL property is

  select * from master where MasterID=1

then the query only works if RequestLive=FALSE.  If RequestLive=TRUE,
I get an EDBEngineError "Could not find object" (error code 8712)
when I try to set the query's Active property to TRUE in the Object

I have never seen this error in any other circumstance.  Live queries
with a "where" clause work fine with Paradox and Interbase, and live
queries without a "where" clause work fine in SQL Server.  What am I

System specs:
Delphi 3.02 running on Windows 98 (same problem under Windows 95)
Microsoft SQL Server 6.5 SP3 on Windows NT Server 4.0 SP3
BDE 5.0
native MSSQL driver (same problem with ODBC SQL Server driver)

Thanks in advance.

Industrial Images


Re:The "WHERE" clause and live queries

Don't use REQUEST LIVE (RL)! It's too slowly ! RL is only to Desktop App.

When you use RL with queries, the queries (internaly) changes to a table.

Don't use table with SQL Servers ! Look the SQL Monitor !

Try to use TUpdateSQL.  Using it you can 'simulate' request live.

IMO, if you wanna improve performance you can use TStoredProc and stored
procedures in the SQL Server

Jucimar Junior
FUCAPI - Manaus - AM - Brasil

Re:The "WHERE" clause and live queries

Thank you very much for the helpful guidelines

Industrial Images

Re:The "WHERE" clause and live queries

Check that the column name MasterID is case correct, I had a similar problem
in SQL SERVER 6.5.
It turned out that coulmn names are case sensitive.

Give that a try.

Mark Pilgrim <*NO*SPAM*> wrote in message

the TQuery.SQL property is

>  select * from master where MasterID=1

Other Threads