主题:帮忙看看下面的备份代码为什么不行?//
先选择目录
procedure Tcopyform.BtnOpenClick(Sender: TObject);
var
dir,root:string;
begin
root:=ExtractFileDir(paramstr(0));
if SelectDirectory('选择路径',root,Dir) then
edit1.Text:=Dir;
end;
procedure Tcopyform.BtnBackUpClick(Sender: TObject);
var
newpath:string;
begin
newpath:=edit1.Text+'\mhpc.bak';
if main.conn.Connected then
main.conn.Close;
try
with main.adoquery1 do
begin
main.adoquery1.close;
main.adoquery1.sql.Clear;
main.adoquery1.sql.add('backup database mhpc to disk=''newpath''');
execsql;
end;
showmessage('备份完成');
except
showmessage('备份失败');
end;
main.conn.Open();
end;
显示备份成功 为什么找不到备份文件啊!!!!!!
procedure Tcopyform.BtnOpenClick(Sender: TObject);
var
dir,root:string;
begin
root:=ExtractFileDir(paramstr(0));
if SelectDirectory('选择路径',root,Dir) then
edit1.Text:=Dir;
end;
procedure Tcopyform.BtnBackUpClick(Sender: TObject);
var
newpath:string;
begin
newpath:=edit1.Text+'\mhpc.bak';
if main.conn.Connected then
main.conn.Close;
try
with main.adoquery1 do
begin
main.adoquery1.close;
main.adoquery1.sql.Clear;
main.adoquery1.sql.add('backup database mhpc to disk=''newpath''');
execsql;
end;
showmessage('备份完成');
except
showmessage('备份失败');
end;
main.conn.Open();
end;
显示备份成功 为什么找不到备份文件啊!!!!!!