默认情况下,查询结果是只读的。应用程序可以用数据控件去显示查询结果,
但用户不能编辑数据。怎样才能使用户能够编辑数据呢?要使用户能够编辑数据
,必须把TQuery构件的RequestLive属性设为True。不过,把RequestLive属性
设为True并不能保证查询结果一定是可以修改的,因为这还取决于查询使用的是
Local SQL还是与服务器相关的SQL。像查询Paradox或dBASE以及异构查询都是
使用Local SQL,而查询远程服务器则使用与服务器相关的SQL。即使RequestLive
属性设为True,而且查询的是本地数据库,但由于SELECT语句的文法不合适,
BDE也将返回只读的查询结果。因此,在编辑数据之前,先要访问CanModify属性。
只有当这个属性返回True时,才表示查询结果是可编辑的。
但用户不能编辑数据。怎样才能使用户能够编辑数据呢?要使用户能够编辑数据
,必须把TQuery构件的RequestLive属性设为True。不过,把RequestLive属性
设为True并不能保证查询结果一定是可以修改的,因为这还取决于查询使用的是
Local SQL还是与服务器相关的SQL。像查询Paradox或dBASE以及异构查询都是
使用Local SQL,而查询远程服务器则使用与服务器相关的SQL。即使RequestLive
属性设为True,而且查询的是本地数据库,但由于SELECT语句的文法不合适,
BDE也将返回只读的查询结果。因此,在编辑数据之前,先要访问CanModify属性。
只有当这个属性返回True时,才表示查询结果是可编辑的。
解决方案 »
- sle4442卡怎么读卡号
- 如何得到比较精准的浮点数?
- connection与connectiongstring的区别
- 画滚动的圆
- 急聘delphi+sqlServer , 实际工作经验一年以上。学历无要求 。年龄无要求。
- 请问procedure AddItem中的参数该写什么
- 怎么忽略空格字符
- 请教各位哪有以下几本书免费下载,能下来一定给分
- TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite);居然不能打开正在执行的文件
- SQL语句中between…… and 的奇怪问题.(初学者的献礼2)
- 关于两个Query通过一个DataSource建立主子关系的问题?
- 一個簡單的SQL語句
Everything in the SELECT clause is a simple column reference or a calculated column, no aggregation is allowed. Calculated columns remain read-only.
The table referenced in the FROM clause is an updatable base table.
There is no GROUP BY or HAVING clause.
There are no subqueries in the statement.
There is no ORDER BY clause.The read-only effect of an ORDER BY clause is negated and the query updatable if the ORDER BY clause uses a single column and there is a dBASE single-column primary or secondary index based on that same field. dBASE compound (expression) indexes will not negate the read-only effect of an ORDER BY clause. A Paradox single- or multi-field primary index will make the query updatable if the ORDER BY uses exactly the same columns (in the same order) as the index. Paradox secondary indexes will not negate the read-only effect of an ORDER BY clause.Multi-table queriesAll queries that join two or more tables will produce a read-only result set.
‘edit’语句。
工作量并不大。(习惯了)