ADOcommand 执行后的数据库文件的更新时间或其他办法(100分)

  • 主题发起人 lovezhou
  • 开始时间
L

lovezhou

Unregistered / Unconfirmed
GUEST, unregistred user!
请看这段代码
Form2.Adocommand1.connectionstring :='Provider=Microsoft.Jet.OLEDB.4.0;Password="";Data Source='+
tmpfile + ';Persist Security Info=True';
S1 := 'insert into sumdata select * from sumdata in "' + Form2.gsDatabase +'"';
Form2.ADOCommand1.CommandText := S1;
try
Form2.ADOCommand1.Execute ;
finally
sleep(5000) //加上后才能正确copy ,但是如果记录上万条呢5秒够不够呢?
copyfile(Pchar(tmpfile),Pchar(bkfile),false);
copyfile(Pchar(tmpfile),Pchar(zbfile),false);
end;
我想知道,ADOCommand执行后,是不是数据库文件还没有马上更新?什么时候更新完毕?


 
try
Form2.ADOCommand1.Execute ;
sleep(5000)
finally
//sleep(5000) //加上后才能正确copy ,但是如果记录上万条呢5秒够不够呢?
while Form2.ADOCommand1.state in[stExecuting] do
sleep(100)
if Form2.ADOCommand1.state not in[stExecuting] then
begin
copyfile(Pchar(tmpfile),Pchar(bkfile),false);
copyfile(Pchar(tmpfile),Pchar(zbfile),false);
end;
end;
 
多谢 ugvanxk ....
 
顶部