#include "stdafx.h"
#include
#include "stdio.h"
#include
#include
using namespace std;
/*
Filepath :数据库文件路径,不包括文件名例如:Filepath="..\\"
SrcFileName :源文件名
*/
static bool compressMDB(const std::string& Filepath,const std::string &SrcFileName)
{
string backupfilepath;//备份文件夹路径
backupfilepath=Filepath;
backupfilepath+="BackUp";
string srcpath=Filepath;//源文件路径,包括源文件
srcpath+=SrcFileName;
string backup=backupfilepath;//源文件备份路径,包括源文件
backup+="\\";
backup+=SrcFileName;
#if 0
if(CopyFile(backup.c_str(),srcpath.c_str(),FALSE))
{
cout<<"还原成功"<CompactDatabase(strSourceConnection.c_str(), strDestConnection.c_str());
}
catch(...)
{
if(CopyFile(backup.c_str(),srcpath.c_str(),FALSE))
{
cout<<"还原成功"<