![]() |
| Form Restore |
Dibulan yang penuh berkah ini sambil menunggu waktu berbuka puasa saya sempatkan untuk berbagi kepada para sahabatku pencinta Visual Foxpro khususnya bagi teman-teman yang baru berkenalan dengan Microsoft Visual Foxpro. Pada kesempatan kali ini saya akan membahas tentang tutorial membuat Form restore. di artikel sebelumnya saya pernah menulis tutorial tentang bagaimana membuat form backup, maka kali ini saya akan menulis tentang tutorial membuat form restore. Mungkin sebagian dari teman-teman ada yang belum paham apa fungsi dari form restore. Restore itu sendiri berarti mengembalikan data setelah kita ambil yang dikenal dengan istilah backup. Setelah data di backup kemudian di taruh pada media penyimpanan lain, maka untuk bisa menggunakan kembali data tersebut harus melalui proses restore yaitu mengembalikan data yang telah di backup tadi.
Data apa saja yang ingin dikembalikan, itu semua tergantung dari pada setiap user yang menginginkan datanya kembali. Untuk lebih lanjut kita langsung praktek saja membuat form restore melalui Visual Foxpro. Dalam kasus kali ini saya ingin mengembalikan data yang sudah di backup dalam bentuk arsip yang sudah di zip atau rar. Langkah awal buka Microsoft Visual Foxpro, kemudian buat form baru dan atur objek, property serta value dari masing-masing objek tersebut seperti tabel di bawah ini.
OBJEK
|
PROPERTY
|
VALUE
|
Form 1
|
Autocenter
|
.T.
|
Backcolor
|
255,255,255
| |
Borderstyle
|
2 – Fixed Dialog
| |
Caption
|
Form Restore
| |
ControlBox
|
.F.
| |
Height
|
258
| |
Name
|
Frmrestore
| |
Width
|
445
| |
WindowType
|
1-Modal
| |
Keypress
|
IF nkeycode= 27
thisform.Release()
ENDIF
| |
Load
|
CLOSE DATABASES
PUBLIC nm
nm=' '
| |
Shape9
|
Backcolor
|
255,255,255
|
Backstyle
|
0 – transparent
| |
Bordercolor
|
255,255,255
| |
Curvature
|
13
| |
Height
|
63
| |
Name
|
Shape9
| |
Specialeefect
|
1 – plain
| |
Style
|
3 – themed
| |
Top
|
24
| |
Width
|
420
| |
Label1
|
Autosize
|
.t.
|
Backstyle
|
0 –transparant
| |
Caption
|
File Sumber
| |
Fontbold
|
.t.
| |
Fontsize
|
10
| |
Forecolor
|
185,0,0
| |
Height
|
18
| |
Left
|
36
| |
Name
|
Label1
| |
Top
|
44
| |
Width
|
80
| |
Label4
|
Caption
|
:
|
Text Box
|
Format
|
!R
|
Height
|
23
| |
Left
|
140
| |
Name
|
Txtnama
| |
Theme
|
.F.
| |
Top
|
41
| |
Width
|
213
| |
Command button
|
Caption
|
…
|
Click
|
nm=GETFILE('RAR,dbf','pilih berkas backup :', 'pilih',0,'pilih berkas backup')
thisform.txtnama.Value=nm
| |
Fontblod
|
.T.
| |
Height
|
28
| |
Left
|
362
| |
Mousepointer
|
99 –custom
| |
Name
|
Command1
| |
Top
|
39
| |
Width
|
36
| |
Olecontrol1
|
Height
|
25
|
Left
|
12
| |
Top
|
114
| |
Width
|
419
| |
Shape1
|
Backcolor
|
255,255,255
|
Bordercolor
|
255,255,255
| |
Curvature
|
13
| |
Height
|
73
| |
Left
|
11
| |
Name
|
Shape1
| |
Specialeffect
|
1 – plain
| |
Style
|
3 – themed
| |
Top
|
158
| |
Width
|
291
| |
Label2
|
Autosize
|
.t.
|
Backstyle
|
0 – transparent
| |
Caption
|
Sebelum proses restore dilakukan pastikan data sedang tidak dipakai
| |
Fontbold
|
.t.
| |
Forecolor
|
185,0,0
| |
Height
|
32
| |
Left
|
56
| |
Name
|
Label2
| |
Top
|
177
| |
Width
|
199
| |
Wordwrap
|
.t.
| |
Shape2
|
Backcolor
|
255,255,255
|
Backstyle
|
0 – transparent
| |
Bordercolor
|
255,255,255
| |
Curvature
|
13
| |
Height
|
74
| |
Left
|
310
| |
Name
|
Shape2
| |
Specialeffect
|
1 – plain
| |
Style
|
3 – themed
| |
Top
|
158
| |
Width
|
122
| |
Command button
|
Caption
|
\<Restore
|
Height
|
27
| |
Left
|
331
| |
Mousepointer
|
99 – custom
| |
Name
|
Command 2
| |
Top
|
167
| |
Width
|
84
| |
Command button
|
Caption
|
\<Tutup
|
Height
|
27
| |
Left
|
332
| |
Mousepointer
|
99 – custom
| |
Name
|
Command3
| |
Top
|
195
| |
Width
|
84
|
command2.Click
LOCAL A,B
A=thisform.olecontrol1.max
B=thisform.olecontrol1.value
IF B<A
thisform.olecontrol1.value=B+99
ENDIF
***
IF EMPTY(ALLTRIM(thisform.txtnama.Value))
thisform.command1.Click
RETURN
ENDIF
***
IF !FILE('rar.exe')
MESSAGEBOX('File untuk
Restore tidak ditemukan',48,'Perhatian')
RETURN
ENDIF
nm=ALLTRIM(thisform.txtnama.Value)
IF !UPPER(RIGHT(nm,3))='RAR'
MESSAGEBOX('File Restore
tidak Valid',48,'Perhatian')
RETURN
ENDIF
***
WAIT WINDOW 'Sedang
Restore...' NOWAIT
fldata='-0+'
!rar x &nm &fldata
WAIT WINDOW 'Restore
Selesai!' NOWAIT
MESSAGEBOX('Restore
Selesai',64,'Perhatian')
thisform.Release()
command3.Click
thisform.Release()

0 comments:
Posting Komentar