此代码调用 Sqlite3.exe 进行数据库备份,但由于参数中的“>”符号而无法正常工作。你能告诉我如何解决吗?
procedure TfAdmin.DoDBBackup(ADBBackupFile: String);
var
b, p, q: String;
ps: TShellExecuteInfo;
begin
b := ExtractFilePath(ParamStr(0)) + 'PPDB.bak';
p := ExtractFilePath(ParamStr(0)) + 'sqlite3.exe';
q := ExtractFilePath(ParamStr(0)) + 'PPDB.db .dump > ' + b; //here lies the problem
ShowMessage(p + ' ' + q);
fMain.UniConnection1.Close;
try
// Execute process and wait for it to terminate
FillChar(ps, SizeOf(ps), 0);
ps.cbSize := SizeOf(ps);
ps.Wnd := Handle;
ps.lpVerb := Nil;
ps.fMask := SEE_MASK_FLAG_NO_UI or SEE_MASK_NOCLOSEPROCESS;
ps.lpFile := PChar(p);
ps.lpParameters := PChar(q);
ps.nShow := SW_SHOWNORMAL;
if not ShellExecuteEx(@ps) then
RaiseLastOSError;
if ps.hProcess <> 0 then
begin
while WaitForSingleObject(ps.hProcess, 50) = WAIT_TIMEOUT do
application.ProcessMessages;
CloseHandle(ps.hProcess);
end;
finally
fMain.UniConnection1.Open;
end;
end;