怎样才能在Delphi中修改和删除ACCESS数据库中的数据?(100分)

  • 主题发起人 主题发起人 海客
  • 开始时间 开始时间

海客

Unregistered / Unconfirmed
GUEST, unregistred user!
我可以用SQL语句增加ACCESS数据库中的数据,但删除和修改时会出现写保护错,不知为什么?ACCESS数据库没有加写保护。
 
TQuery.RequestLive

Specifies whether an application expects to receive a live result set from the Borland Database Engine (BDE) when the query executes.

property RequestLive: Boolean;

Description

Set RequestLive to specify whether or not the BDE should attempt to return a live result set to the application. RequestLive is False by default, meaning that a query always returns a read-only result set.

Set RequestLive to True to request a live result set. Setting RequestLive to True does not guarantee that a live result set is returned by the BDE. The BDE returns a live result set only if the SELECT syntax of the query conforms to the syntax requirements for a live result set. If RequestLive is True, but the syntax does not conform to the requirements, the BDE returns a read-only result set for Paradox or dBASE, or an error return code for remote servers.

After activating the TQuery, inspect the CanModify property to determine whether the request for a live result set was successful.

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.
 
你用的是TQuery?
 
看看bde alias中open mode设置是不是read/write的
sqlpassthru mode是不是shared autocommit
 
我用的是Delphi5.0中的TAdo系列控件
 
用d5中的控件比较容易.
如不是d5,只有通过bde.
 
"写保护错"? 出错信息是什么?
 
sorry,前面答非所问。
检查你的库中是否有规则,一致性校验
 
TQuery.RequestLive=True;
 
如果有人参与讨论这个问题,请用EMail通知我。
 
接受答案了.
 
后退
顶部