-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.frm
263 lines (259 loc) · 8.07 KB
/
Form1.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
VERSION 5.00
Begin VB.Form Form1
BackColor = &H00FFFFFF&
BorderStyle = 1 'Fixed Single
Caption = "Login"
ClientHeight = 6795
ClientLeft = 4575
ClientTop = 2310
ClientWidth = 10695
FillColor = &H00FFFFFF&
FillStyle = 4 'Upward Diagonal
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6795
ScaleWidth = 10695
Begin VB.CommandButton Command1
Appearance = 0 'Flat
BackColor = &H00E0E0E0&
Caption = "LOGIN"
BeginProperty Font
Name = "Times New Roman"
Size = 11.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 7980
MaskColor = &H00FFFFFF&
Style = 1 'Graphical
TabIndex = 6
Top = 3750
Width = 2325
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
BeginProperty Font
Name = "Arial"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
IMEMode = 3 'DISABLE
Left = 4800
PasswordChar = "*"
TabIndex = 5
Top = 2940
Width = 5505
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BeginProperty Font
Name = "Arial"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 4800
TabIndex = 2
Top = 1710
Width = 5505
End
Begin VB.PictureBox Picture1
Height = 6795
Left = 0
ScaleHeight = 6735
ScaleWidth = 4275
TabIndex = 0
Top = 0
Width = 4335
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "Admin Login"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 7620
TabIndex = 10
Top = 5520
Width = 1695
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "Other Options:"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 6030
TabIndex = 9
Top = 5520
Width = 1605
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "Register Here"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 345
Left = 7500
TabIndex = 8
Top = 5010
Width = 1485
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "Not a User ? "
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6060
TabIndex = 7
Top = 5010
Width = 1305
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "PASSWORD :"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 4800
TabIndex = 4
Top = 2370
Width = 2625
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "USERNAME :"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4800
TabIndex = 3
Top = 1140
Width = 2625
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "ENTER LOGIN CREDENTIALS"
BeginProperty Font
Name = "Times New Roman"
Size = 15.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 4800
TabIndex = 1
Top = 240
Width = 5505
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim username, password, db_path, sql As String
username = Text1.Text
password = Text2.Text
If (username = "" Or password = "") Then
MsgBox ("Please Enter Your Credentials")
Else
sql = "SELECT * FROM UserDetails WHERE UserName = '" & username & "'"
db_path = App.Path + "\db\" + "MovieRatingSystem.mdb"
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
cn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=" & db_path
Set rs = New ADODB.Recordset
rs.Open sql, cn, adOpenStatic, adLockOptimistic
If (rs.Fields("PASSWORD").Value = password) Then
Unload Me
current_user = username
Form4.Show
Else
Text2.Text = ""
MsgBox ("Invalid Credentials! Please Re-enter Your credentials.")
End If
cn.Close
End If
End Sub
Private Sub Form_Load()
Dim image_folder_path As String
image_folder_path = App.Path & "\db\image_database"
Picture1.AutoRedraw = True
Set Pic = LoadPicture(image_folder_path + "\mrs.bmp")
Picture1.PaintPicture Pic, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight
Set Picture1.Picture = Picture1.Image
End Sub
Private Sub Label5_Click()
Unload Me
Form2.Show
End Sub
Private Sub Label7_Click()
Unload Me
Form3.Show
End Sub