关于table.post很奇怪的错误???近者有分!!(50分)

O

okgxsh

Unregistered / Unconfirmed
GUEST, unregistred user!
[red][/red][:)]关于table.post很奇怪的错误???近者有分!!
我没用数据库引擎,而是设定路径,直接对表操作
//++++++++++++++++++++++++++++++++++++++++++++++
btninsert.click//事件中
if not table1.eof then
begin
table1.edit;
table1.insert;
end
else
begin
table1.edit;
table1.append;
end;
//+++++++++++++++++++++++++++++++++++++++++++++
btnpost.click //事件中
begin
table1.edit;
table1.post;
table1.refresh;
end;
//////////////////问题出来了!!!!!
当我插入几条纪录后,点击保存按钮;点击最小化把程序放在了任务栏;
然后我重新启动计算机;打开程序,刚刚插入的记录全没了!!!!
我明明点击保存了呀!!!;但是当我把程序关闭在重启数据就不会丢失!
为什末??为什末?为什末?为什末?
 
//++++++++++++++++++++++++++++++++++++++++++++++
btninsert.click//事件中
if not table1.eof then
begin
table1.insert;
end
else
begin
table1.append;
end;
//+++++++++++++++++++++++++++++++++++++++++++++
btnpost.click //事件中
begin
table1.post;
table1.refresh;
end;
//////////////////问题出来了!!!!!
 
1、insert和append语句使用时不需要先使用edit
2、post以后再确认提交就可以
table1.CachedUpdates:=true;
table1.CommitUpdates;

paradox表也可以使用
table1.FlushBuffers;

试试看
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
955
SUNSTONE的Delphi笔记
S
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
顶部