var hfsjk: TADOQuery;
    bfmc:string;
begin
    if self.OpenDialog1.Execute then
    begin
    mydata.ADOConnection1.Close;    //ADOConnection1,连在 dslfwxt 这个上的
 
    mydata.ADOConnection1.Connected:=false;
    bfmc:=self.OpenDialog1.FileName;
    hfsjk:= TADOQuery.Create(self);
    hfsjk.Connection:=mydata.ADOConnection2;
    mydata.ADOConnection1.Connected:=false;
    hfsjk.SQL.Clear;
    hfsjk.SQL.Add('restore database dslfwxt from disk='+#39+bfmc+#39);
if  hfsjk.ExecSQL<>0 then
    begin
    mydata.ADOConnection1.ConnectionString:='Provider=SQLOLEDB.1;Password=12345;Persist Security Info=True;User ID=sa;Initial Catalog=dslfwxt;Data Source=TYP';
    mydata.ADOConnection1.Connected:=true;
    end;
    end;
我把 dslfwxt 删掉就可以,现在我要在上面覆盖,就不不可以阿,提示,正在访问,不能获得排他访问权