我用的是
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('restore database 数据库名 from disk='''+'D:\qiujing\bak\2003-09-05.mdf'+''' with replace');
adoquery1.ExecSQL;
然后提示说:Project setup1.exe raised exception class EOLeException with message 'The file '数据库路径'cannot be overwritten.It is being used by database '数据库名'.Process stopped.Use Step or Run to continue.
哪位知道是怎么回事啊?
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('restore database 数据库名 from disk='''+'D:\qiujing\bak\2003-09-05.mdf'+''' with replace');
adoquery1.ExecSQL;
然后提示说:Project setup1.exe raised exception class EOLeException with message 'The file '数据库路径'cannot be overwritten.It is being used by database '数据库名'.Process stopped.Use Step or Run to continue.
哪位知道是怎么回事啊?
解决方案 »
- 如何在这里得到ListView某列的值?
- 代码创建form上的image没有刷新
- 請問在DELPHI中如何製作HTML編輯器,可以讓網站直接讀取的那種,像DW那樣的.
- 你信吗,其实一开始我自己都不信.....
- 图片怎么不能刷新?
- 请问我想禁止ComboBox 或DBLookupComboboxEh1的自动填充功能
- 我用DBchar,dataset用ADOquery,但是为什么x,y里看不到字段值,和什么设置有关系吗?高手指点
- 请问在DEDLPHI中如何接收和发送数据包,接收包后如何打开用什么控件打开!
- 数据表修改出错,帮帮我!!谢谢了先
- 再问Atom 关于<<将网页内容保存为字符串以及根据字符串显示成网页>>
- 我用LISTVIEW显示一条数据记录,但一点击就不见了,什么原因?
- Sos~关于类~
use master
go
create proc killspid (@dbname varchar(20))
as
begin
declare @sql nvarchar(500),@temp varchar(1000)
declare @spid int
set @sql='declare getspid cursor for
select spid from sysprocesses where dbid=db_id('''+@dbname+''')'
exec (@sql)
open getspid
fetch next from getspid into @spid
while @@fetch_status < >-1
begin
set @temp='kill '+rtrim(@spid)
exec(@temp)
fetch next from getspid into @spid
end
close getspid
deallocate getspid
end use master
exec killspid 'dbname'
應是while @@fetch_status =0