在编程时,(30分)

  • 主题发起人 主题发起人 ★蓝天★
  • 开始时间 开始时间

★蓝天★

Unregistered / Unconfirmed
GUEST, unregistred user!
在编程时,

with query1 do
begin close;
sql.clear;
sql.Add('select * from a where n6="T";');
open;
end;
while (not query1.IsEmpty) do
begin query1.Edit;
query1.FieldByName('N6').asstring:='n';
query1.Post; ..............
..................
当程序运行到 :query1.edit;时,出现如下错误:project project1.exe raised
exception class Edatabaseerror with message 'query1:cannot modify a read only
dataset'.process stopped.use step or run to continue 问为什么会这样,该怎么
解决?
 
query1的RequestLive 是不是设为了 true?

另:sql.Add('select * from a where n6="T";');
T 后边的;是干吗用的?
 
是不是Query的ReadOnly属性设置为True ??
 
此问题应该结束了,楼上的两位大侠说的不错。
 
他们说得不对 应该是在查询前将Query.RequestLive设置为True,给分吧。分号有没有无所谓的
 
多人接受答案了。
 

Similar threads

A
回复
0
查看
950
Andreas Hausladen
A
A
回复
0
查看
833
Andreas Hausladen
A
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部