我的数据恢复是这么写的
 adoQuery1.Sql.Add('restore database finder_farming from disk='''+Edit1.Text +'''WITH replace,stats');
但总是提示the database is in use请问要怎么做才对呢

解决方案 »

  1.   

    数据库在使用中,先将adoconnection.active:=false;
      

  2.   

    我把数据库断开了它还是提示sqlserver不存在或反问被拒绝,是怎么回事呢
      

  3.   

    你将连接练到服务器上的另外一个数据库比如master库,然后再restore,如果你想察看是否还有其他的用户在使用,可以查看sysproccess表,然后将相关进程kill后就可以了。
      

  4.   

    我是连接到服务器上的master库来进行恢复的,就是不行
      

  5.   

    用select * from sysproccess where host_name is not null and db_id = object_id('你的数据库')
    看看谁在上面。
    --------------------------------------
    看见了么,
    那支蛾子,
    正飞向太阳,
    那就是我!
    --------------------------------------