Languages :: Delphi :: how to mysqldump with delphi ? |
|||
| By: Nono |
Date: 24/03/2008 10:16:40 |
Points: 20 | Status: Answered Quality : Excellent |
| how to mysqldump with delphi ? | |||
| By: VGR | Date: 24/03/2008 10:21:50 | Type : Answer |
|
| hello, there are probably more than one solution to this problem, but the first one I see is to stupidly execute the executable in the shell... You may look into the Win API for ShExecute() but I designed a function ExecNewProcess() : (parts of it were probably copy-pasted from some Delphi resource years ago, full credits go to it) Function ExecNewProcess(ProgramName : String; doWait : Boolean = False) : Boolean; var StartInfo : TStartupInfo; ProcInfo : TProcessInformation; CreateOK : Boolean; begin { fill with known state } FillChar(StartInfo,SizeOf(TStartupInfo),#0); FillChar(ProcInfo,SizeOf(TProcessInformation),#0); StartInfo.cb := SizeOf(TStartupInfo); CreateOK := CreateProcess(nil, PChar(ProgramName), nil, nil,False, CREATE_NEW_PROCESS_GROUP+NORMAL_PRIORITY_CLASS, nil, nil, StartInfo, ProcInfo); { check to see if successful } if CreateOK then //may or may not be needed. Usually wait for child processes if doWait then WaitForSingleObject(ProcInfo.hProcess, INFINITE); ExecNewProcess:=CreateOK; end; |
|||
|
Do register to be able to answer |
|||
| Add This Article To: | |||
| |
|
|
|
| |
|
|
|









