procedure TForm1.Button1Click(Sender: TObject);
begin
AdoCommand1.CommandText:='backup database test to disk=:A with init';
adocommand1.Parameters.ParamByName('A').Value:='d:\TestBackUp\'+'dbtest.dat';
adocommand1.Execute;
procedure TDBBackUpRestore.BackUpDB;
begin
with DMMain.QryComm do
begin
Close;
SQL.Clear;
SQL.Add('Bakcup Database '+FDBName+' to disk= '+FPath+' with init');
Execute;
Close;
end; // with
end;
procedure TDBBackUpRestore.ReStoreDB;
begin
with DMMain.QryComm do
begin
Close;
SQL.Clear;
SQL.Add('ReStore DataBase '+FDBName+' From Disk= '+FPath);
Execute;
Close;
end; // with
end;
200分,呵呵
Procedure HYUANDatebaseOk(DBname ,SoureName : String);
begin
with SqlCommand do
begin
CommandText:='use Master';//
Execute;
ClearMSSQLUser(DBname);
CommandText:='execute sp_helpdevice';//系统存储过程
Execute;
CommandText:='Restore database '+DBname+' From disk='''+SoureName+''' with replace';
Execute;
end;
end;//DBname 备份库名称 //SoureName 那个盘
Procedure BakUpdatebameOk(BkDBname,MDFileStr : String);
begin
with SqlCommand do
begin
CommandText:='use Master';
Execute;
CommandText:='execute sp_helpdevice';//系统存储过程
Execute;
CommandText:='backup database '+BkDBname+' to disk='''+MDFileStr+''' with init';
Execute;
CommandText:='Use '+BkDBname;
Execute;
end;
end;