Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //script Back up
- if MessageDlg('Yakin Ingin BackUp Data..??',mtConfirmation,[mbYes]+[mbno],0)=mryes then
- begin
- SaveDialog1.Execute;
- if SaveDialog1.FileName<>'' then
- begin
- ShellExecute(Self.Handle, PChar('open'),
- PChar('C:\xampp\mysql\bin\mysqldump.exe'),
- PChar('-uroot -hlocalhost -R -r "'+ SaveDialog1.FileName+'.sql" db_apotik'),
- PChar('C:\xampp\mysql\bin'),SW_SHOW);
- MessageDlg('Data Berhasil Dibackup',mtInformation,[mbOK],0);
- end
- else
- MessageDlg('Data gagal Dibackup',mtInformation,[mbOK],0);
- end;
- //script restore
- if MessageDlg('Yakin Ingin Restore Data..??',mtConfirmation,[mbYes]+[mbno],0)=mryes then
- begin
- OpenDialog1.Execute;
- if OpenDialog1.FileName<>'' then
- begin
- ShellExecute(Self.Handle,PChar('open'),
- PChar('C:\xampp\mysql\bin\mysql.exe'),
- PCHAR('-uroot -hlocalhost -e "drop database if exists db_apotik; '+
- 'create database db_apotik; use db_apotik;\. '+OpenDialog1.FileName+'"'),nil,SW_HIDE);
- MessageDlg('Data Berhasil di Restore !!', mtInformation, [mbOK], 0);
- end
- else
- MessageDlg('GAGAL. Harap Pilih Lokasi !!!', mtInformation, [mbOK], 0);
- end;
Advertisement
Add Comment
Please, Sign In to add comment