数据库为: Paradox.
数据控件为 Query1;
  Query1.CachedUpdates := True;
  Query1.RequestLive := True;
SQL文中有  order by; where条件。下句可有可无都没有影响:
  Query1.UpdateObject := UpdateSQL1;
当我新增,删除的时候
 Query1.post;这一句出错,说我不能修改只读Query1.请问那里有相关属性设置的文章。谢谢!

解决方案 »

  1.   

    paradox有order by时就不能修改了。
      

  2.   

    有order by,union等的query返回的都是只读数据集,还有那些我记不起来了,查到再告诉你
      

  3.   

    呵呵!找到了To request a result set that users can edit in data-aware controls, set a query component's RequestLive  property to True. Setting RequestLive to True does not guarantee a live result set, but the BDE attempts to honor the request whenever possible. There are some restrictions on live result set requests, depending on whether the query uses the local SQL parser or a server's SQL parser. Queries where table names are preceded by a BDE database alias (as in heterogeneous queries) and queries executed against Paradox or dBASE are parsed by the BDE using Local SQL. When queries use the local SQL parser, the BDE offers expanded support for updatable, live result sets in both single table and multi-table queries. When using Local SQL, a live result set for a query against a single table or view is returned if the query does not contain any of the following:DISTINCT in the SELECT clause
    Joins (inner, outer, or UNION)
    Aggregate functions with or without GROUP BY or HAVING clauses
    Base tables or views that are not updatable
    Subqueries
    ORDER BY clauses not based on an index
    Queries against a remote database server are parsed by the server. If the RequestLive property is set to True, the SQL statement must abide by Local SQL standards in addition to any server-imposed restrictions because the BDE needs to use it for conveying data changes to the table. A live result set for a query against a single table or view is returned if the query does not contain any of the following:A DISTINCT clause in the SELECT statement
    Aggregate functions, with or without GROUP BY or HAVING clauses
    References to more than one base table or updatable views (joins)
    Subqueries that reference the table in the FROM clause or other tablesIf an application requests and receives a live result set, the CanModify property of the query component is set to True. Even if the query returns a live result set, you may not be able to update the result set directly if it contains linked fields or you switch indexes before attempting an update. If these conditions exist, you should treat the result set as a read-only result set, and update it accordingly .If an application requests a live result set, but the SELECT statement syntax does not allow it, the BDE returns eitherA read-only result set for queries made against Paradox or dBASE.
    An error code for SQL queries made against a remote server.
      

  4.   

    query 有order by  语句则不能编辑
      

  5.   

    除了上面说的一些外,还得加上一句:Query1.RequestLive:=True;
      

  6.   

    有order by,query返回的都是只读数据集!
    有问题请发信息到我的E-mail:[email protected]
      

  7.   

    你需要使用updateSQL控件,CacheUpdate属性设置为true时候,保存在本地,要提交到数据库之后才能实现更新,而为false时候,则直接保存到数据库。