数据库(Sql Server)恢复
procedure Tfbackstore.BitBtn2Click(Sender: TObject);begin
if OpenDialog1.Execute then
begin
with data.backstorequery do
begin
try
data.connection.Connected:=false;
DisableControls;
Close;
SQL.Clear;
Parameters.Clear;
SQL.Add('RESTORE DATABASE projectmanage from disk = ''' + OpenDialog1.FileName + ''' WITH RESTART');
ExecSQL;
ShowMessage('恢复成功!');
data.connection.Connected:=true;
Close;
EnableControls;
except
ShowMessage('恢复失败!');
exit;
end;
end;
end;
end;
数据库正在使用,没有获得排它访问权!怎么解决,大家帮帮忙
很急,在线等