不如路过各位高手有没有做过这样的功能模块:在C/S模式中,在前台即客户端编写代码来实现服务器中的数据库的备份与还原.我现在帮单位做了个系统,但是单位的另外一个分公司也要用到这个系统,所以我就想每个星期备份一次数据然后发到分公司那边还原过来,这样两边的数据就能够统一了,但是每次要从服务器里面的SQL里面备份出来再在分公司服务器里面的SQL还原这样就在麻烦了.所以我就想能够在前台来实现这样方便一点

解决方案 »

  1.   

    if opendialog1.Execute then
      begin    try
            ADOConnection1.Execute('Backup   DataBase   '+SERVERDATA+'   to   disk='''+opendialog1.FileName+'''');
            statusbar1.Panels.Items[1].Text:='备份成功!';
        except on E: Exception do  begin //ErrorDialog(E.Message, E.HelpContext);        Screen.Cursor:=crDefault;
             statusbar1.Panels.Items[1].Text:='备份失败!'+E.Message;
            exit;
            end;
        end; end;