数据还原问题(4分)

  • 主题发起人 主题发起人 wl821205
  • 开始时间 开始时间
W

wl821205

Unregistered / Unconfirmed
GUEST, unregistred user!
我在delphi中做了一个数据还原功能,但在运行过程中,出现了问题,:错误提示是:最后还原成功,但娄据不能打开.代码如下:
procedure TFrm_Main.N14Click(Sender: TObject);
var
Str_Path:string;
begin
AdoConnectmain.Close;
AdoConnectmain.Connected:=false;
opendialog1.Filter:='所有文件(*.)|*.*';
opendialog1.Title:='选择准确的文件路径和文件名';
if opendialog1.Execute then
str_path:=opendialog1.FileName;
if str_path<>''then
begin
try
try
Screen.Cursor := crHourGlass;
adoq_tmp.Close;
adoq_tmp.SQL.Clear;
adoq_tmp.SQL.Add('use master restore DATABASE '+'菜单权限管理'+ ' from DISK =''' +Str_Path+'''');
adoq_tmp.ExecSQL();
Screen.Cursor := crDefault;
Application.MessageBox('数据库恢复成功完成!','数据库恢复',0+mb_iconinformation);
except
Screen.Cursor := crDefault;
Application.MessageBox('数据库恢复失败!请检查备份路径或网络状态','数据库恢复',0+mb_iconinformation);
exit;
end;
Finally
begin
adouser.Close;
adouser.SQL.Clear;
adouser.SQL.Text:='use 菜单权限管理';
adouser.ExecSQL;
end;
end;
end;
end;

end.
 

Similar threads

S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
930
SUNSTONE的Delphi笔记
S
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部