我的TQuery的RequestLive属性设置为了Trun,然后设置Active为Turn时抱错,说找不到表或试图,但是我把RequestLive属性设置为False时,Active为真就不会出错,请问这是怎么回事啊???我现在需要的是TQuery的返回结果可以修改,请问怎么办呢???

解决方案 »

  1.   

    RequestLive is a request that a SELECT query returns an updatable (or live) or read-only result set from the database back-end. A false value for RequestLive (the default) causes the result set to always be read-only. No request is made to the database back-end to return an updatable result set. A true value for RequestLive is a request to database back-end to return an updatable result set. An updatable result set can be made available to the application?
    s user for direct data editing through visual data controls.A true value for RequestLive is a request for an updatable result set. It does not guarantee that the database back-end will return an updatable result set. See the documentation for the specific database system used for the criteria needed for a live query result set. If the database cannot return an updatable result set, a read-only result set is returned instead. This is done automatically and usually without error. Some database systems may raise an exception on requests for live result sets that cannot be fulfilled. Check the success of the request by inspecting the dataset component抯 CanModify property.If the SQL statement used in a TQuery is a general, multi-row SELECT statement, RequestLive can be used with either a true or a false value. For all other SQL statements issued from the TQuery, RequestLive should only be set to false. These other statements include noncursor single-row SELECT statements (more commonly found in stored procedure programming), noncursor Data Manipulation Language (DML) statements like UPDATE or DELETE, and Data Definition Language (DDL) statements like CREATE TABLE and DROP INDEX.Note: All multi-table queries return read-only result sets. Other conditions may cause a query to return a read-only result set. For local tables (such as dBASE and Paradox), see the local SQL help file for rules governing live result sets (updatable queries). For other table types (such as InterBase, Oracle, and Sybase), consult the documentation for the specific database system.
    Note: Some SQL database systems require strict case-sensitivity for names of metadata objects in SQL statements. These SQL databases typically have problems with the way metadata names are passed by the BDE in live queries and an exception is raised. A workaround that helps in most cases is to enclose the metadata object references (like table and column names) in quotation s.
      

  2.   

    确认连接没有错误
    确认可以读取数据如果需要更新结果集,必须设置 RequestLive  为 true
      

  3.   

    设置都是对的,也有数据源,只要RequestLive不为TRUE,什么都是正常的,一为TRUE就出问题了