在delphi中用下面的语句还原数据库:ADOConnection1.Execute('RESTORE DATABASE achieve FROM DISK = ''d:\databak''');出现了这样的错误:
project project2.exe raised exception class EOleException with message '超时已过期'.process stopped
请问这是什么原因,如何才能解决?

解决方案 »

  1.   

    这个我没用过,
    我只用,sql管理器
      

  2.   

    由于数据库没有真正的断开,所有导致超时
    下面的方法(通过AdoCommand)可以实现数据恢复:
             with adocommand_restore do
             begin
              Try
              CommandText:='use Master';
              Execute;
              CommandText:='execute sp_helpdevice';
              Execute ;
              CommandText:='Restore database '+db_name+' From disk='''+FileName+''' with replace';
              Execute ;
              CommandText:='Use '+db_name;
              Execute ;
              Except
                 Abort;
              end;//end of try... except...end
             end;//end of with dm_main.ado