-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBackupDatabase.frm
179 lines (167 loc) · 4.57 KB
/
BackupDatabase.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
VERSION 5.00
Begin VB.Form BackupDatabase
Caption = "Salin File"
ClientHeight = 3255
ClientLeft = 60
ClientTop = 345
ClientWidth = 5955
LinkTopic = "Form2"
ScaleHeight = 3255
ScaleWidth = 5955
StartUpPosition = 2 'CenterScreen
Begin VB.Frame Frame1
Caption = "File Sumber"
Height = 2175
Left = 120
TabIndex = 6
Top = 120
Width = 3615
Begin VB.DriveListBox Drive1
Height = 315
Left = 120
TabIndex = 9
Top = 360
Width = 2000
End
Begin VB.DirListBox Dir1
Height = 1215
Left = 120
TabIndex = 8
Top = 720
Width = 2000
End
Begin VB.FileListBox File1
Height = 1650
Left = 2160
Pattern = "*.mdb"
TabIndex = 7
Top = 360
Width = 1300
End
End
Begin VB.Frame Frame2
Caption = "Direktori Tujuan"
Height = 2175
Left = 3840
TabIndex = 3
Top = 120
Width = 2055
Begin VB.DriveListBox Drive2
Height = 315
Left = 120
TabIndex = 5
Top = 360
Width = 1750
End
Begin VB.DirListBox Dir2
Height = 1215
Left = 120
TabIndex = 4
Top = 720
Width = 1750
End
End
Begin VB.TextBox Text1
Height = 350
Left = 1440
TabIndex = 2
Top = 2400
Width = 3350
End
Begin VB.TextBox Text2
Height = 350
Left = 1440
TabIndex = 1
Top = 2760
Width = 3350
End
Begin VB.CommandButton Command1
Caption = "Copy File"
Height = 750
Left = 4800
TabIndex = 0
Top = 2400
Width = 1000
End
Begin VB.Label Label1
BorderStyle = 1 'Fixed Single
Caption = " Direktori Asal"
Height = 345
Left = 120
TabIndex = 11
Top = 2400
Width = 1305
End
Begin VB.Label Label2
BorderStyle = 1 'Fixed Single
Caption = " Direktori Tujuan"
Height = 345
Left = 120
TabIndex = 10
Top = 2760
Width = 1305
End
End
Attribute VB_Name = "BackupDatabase"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function SHFileOperation Lib "Shell32.dll" Alias "SHFileOperationA" (lpFileOP As shfileopstruct) As Long
Private Const FO_copy = &H2
Private Const fof_allowundo = &H40
Private Type shfileopstruct
hwnd As Long
wfunc As Long
pfrom As String
pto As String
Fflags As Integer
Faborted As Boolean
hnamemaps As Long
sprogress As String
End Type
Public Sub copy(ByVal asal As String, ByVal tujuan As String)
Dim x As shfileopstruct
With x
.hwnd = 0
.wfunc = FO_copy
.pfrom = asal & vbNullChar & vbNullChar
.pto = tujuan & vbNullChar & vbNullChar
.Fflags = fof_allowundo
End With
SHFileOperation x
End Sub
'Private Sub Form_Load()
'Dir1.Path = "C:\Program Pelengkap"
'Dir2.Path = "C:\"
'End Sub
Private Sub Command1_Click()
On Error Resume Next
If Text1 = "" Then
MsgBox "Anda belum memilih file yang akan dicopy"
Exit Sub
ElseIf Text2 = "" Then
MsgBox "Anda tidak memilih direktori tujuan peng-Copy-an"
Exit Sub
End If
copy Text1.Text, Text2.Text
MsgBox "File sudah di copy"
End Sub
Private Sub Command1_KeyPress(Keyascii As Integer)
If Keyascii = 27 Then Unload Me
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Drive2_Change()
Dir2.Path = Drive2.Drive
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Dir2_Change()
Text2.Text = Dir2.Path
End Sub
Private Sub File1_Click()
Text1.Text = File1.Path & "\" & File1.FileName
End Sub