Y
YXBS2129
Unregistered / Unconfirmed
GUEST, unregistred user!
原系统是用ACCESS做数据库的,但是现在将之改为SQL SERVER 2000做数据库.但是在备份时就老是备份原ACCESS的数据库文件'db',该怎么办呢.部分的相关代码如下
procedure Tshujubeifen.SpeedButton1Click(Sender: TObject);
begin
Application.CreateForm(TSelectDir, SelectDir);
SelectDir.DriveComboBox1.Text := ExtractFileDrive(Edit_path.Text);
if (FileExists(Edit_path.Text)) then
SelectDir.DirectoryListBox1.Directory := Edit_path.Text;
if (SelectDir.ShowModal = mrOK) then
Edit2_path.Text := SelectDir.DirectoryListBox1.Directory;
SelectDir.free;
end;
procedure Tshujubeifen.FormCreate(Sender: TObject);
var
SourcePath: string;
begin
inherited;
B_showmessage := true;
SourcePath := ExtractFileDir(Application.ExeName);
if (StrLen(PChar(SourcePath)) <> 3) then
SourcePath := SourcePath + '/';
Edit_path.Text := SourcePath + 'BACKUPDATA/' + formatdatetime('yyyymmdd', date);
end;
procedure Tshujubeifen.SpeedButton2Click(Sender: TObject);
var
SFilePath, DFilePath, SourcePath: string;
MesString: string;
OpStruc: TSHFileOpStruct; //在uses中添加shellapi
FromBuf, ToBuf: array[0..255] of Char;
ShouldCopy: Boolean;
sr: TSearchRec;
FileAttrs: Integer;
label COPYAGAIN;
begin
COPYAGAIN:
// 准备目录拷贝
FillChar(FromBuf, Sizeof(FromBuf), 0);
FillChar(ToBuf, Sizeof(ToBuf), 0);
// 设置OpStruc
with OpStruc do
begin
Wnd := Handle;
wFunc := FO_COPY;
pFrom := @FromBuf;
pTo := @ToBuf;
fFlags := FOF_NOCONFIRMATION or FOF_RENAMEONCOLLISION;
fAnyOperationsAborted := False;
hNameMappings := nil;
lpszProgressTitle := nil;
end;
SourcePath := ExtractFileDir(Application.ExeName);
if (StrLen(PChar(SourcePath)) <> 3) then
SourcePath := SourcePath + '/';
FillChar(FromBuf, Sizeof(FromBuf), 0);
FillChar(ToBuf, Sizeof(ToBuf), 0);
SFilePath := SourcePath + 'db';
StrPCopy(FromBuf, Pchar(SFilePath));
DFilePath := Edit_path.Text;
StrPCopy(ToBuf, Pchar(DFilePath));
procedure Tshujubeifen.SpeedButton1Click(Sender: TObject);
begin
Application.CreateForm(TSelectDir, SelectDir);
SelectDir.DriveComboBox1.Text := ExtractFileDrive(Edit_path.Text);
if (FileExists(Edit_path.Text)) then
SelectDir.DirectoryListBox1.Directory := Edit_path.Text;
if (SelectDir.ShowModal = mrOK) then
Edit2_path.Text := SelectDir.DirectoryListBox1.Directory;
SelectDir.free;
end;
procedure Tshujubeifen.FormCreate(Sender: TObject);
var
SourcePath: string;
begin
inherited;
B_showmessage := true;
SourcePath := ExtractFileDir(Application.ExeName);
if (StrLen(PChar(SourcePath)) <> 3) then
SourcePath := SourcePath + '/';
Edit_path.Text := SourcePath + 'BACKUPDATA/' + formatdatetime('yyyymmdd', date);
end;
procedure Tshujubeifen.SpeedButton2Click(Sender: TObject);
var
SFilePath, DFilePath, SourcePath: string;
MesString: string;
OpStruc: TSHFileOpStruct; //在uses中添加shellapi
FromBuf, ToBuf: array[0..255] of Char;
ShouldCopy: Boolean;
sr: TSearchRec;
FileAttrs: Integer;
label COPYAGAIN;
begin
COPYAGAIN:
// 准备目录拷贝
FillChar(FromBuf, Sizeof(FromBuf), 0);
FillChar(ToBuf, Sizeof(ToBuf), 0);
// 设置OpStruc
with OpStruc do
begin
Wnd := Handle;
wFunc := FO_COPY;
pFrom := @FromBuf;
pTo := @ToBuf;
fFlags := FOF_NOCONFIRMATION or FOF_RENAMEONCOLLISION;
fAnyOperationsAborted := False;
hNameMappings := nil;
lpszProgressTitle := nil;
end;
SourcePath := ExtractFileDir(Application.ExeName);
if (StrLen(PChar(SourcePath)) <> 3) then
SourcePath := SourcePath + '/';
FillChar(FromBuf, Sizeof(FromBuf), 0);
FillChar(ToBuf, Sizeof(ToBuf), 0);
SFilePath := SourcePath + 'db';
StrPCopy(FromBuf, Pchar(SFilePath));
DFilePath := Edit_path.Text;
StrPCopy(ToBuf, Pchar(DFilePath));