Anda di halaman 1dari 2

Code log in animasi

Private Sub Timer1_Timer()


If y < 100 Then
y=y+1
Label1.Caption = "(" & y & "%)"
End If
pb.Value = pb.Value + 1
If pb.Value = pb.Max Then
Form3.Show
Unload Me
End If
End Sub
Private Sub Timer2_Timer()
If Label3.Visible = True Then
Label3.Visible = False
ElseIf Label3.Visible = False Then
Label3.Visible = True
End If
Label2.Caption = Right(Label2.Caption, Len(Label2.Caption) - 1) &
Left(Label2.Caption, 1)
End Sub
Private Sub Timer3_Timer()
If z = False Then
m=m+1
If m = 18 Then z = True
Else
Label4.Visible = False
m=1
z = False
Label4.Visible = True
n=n+1
End If
Select Case n
Case 0
Label4.Caption = " contoh animasi"
Label4.FontName = "arial"
Label4.FontItalic = True
Case 1
Timer3.Enabled = True
End Select
If m <= 0 Then m = 1
Label4.FontSize = m
End Sub
Private Sub Timer4_Timer()
Form2.BackColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
End Sub
Private Sub Timer5_Timer()
Form1.Caption = Right(Form2.Caption, Len(Form2.Caption) - 1) &
Left(Form2.Caption, 1)
End Sub

Code log in
Dim db As Connection
Dim rs As Recordset
Sub koneksi()
Set db = New ADODB.Connection
db.Provider = "microsoft.jet.oledb.4.0"
db.CursorLocation = adUseClient
db.Open App.Path & "\dbbarang.mdb"
End Sub
Private Sub Form_Load()
koneksi
End Sub
Private Sub Command1_Click()
If Text1.Text <> "" And Text2.Text <> "" Then
Set rs = New ADODB.Recordset
rs.LockType = adLockOptimistic
rs.CursorType = adOpenDinamic
rs.Open "select * from login where USERNAME = '" & Text1.Text & "' and PASSWORD
='" & Text2.Text & "'", db, , , adCmdText
If Not rs.EOF Then
MsgBox ("Login Anda Berhasil"), , "Informasi"
Form1.Show
Form3.Hide
Else
MsgBox "User Name dan password Salah Silahkan Ulangi Kembali",
vbCritical, "Informasi"
Exit Sub
End If
End If
End Sub

Anda mungkin juga menyukai