Portal­Home­Gallery­FAQ­Search­Memberlist­Usergroups­Register­Log in
Post new topic   Reply to topicShare | 
 

 sample sql T_T

View previous topic View next topic Go down 
AuthorMessage
[Whiz]~Czechoslovakia
Admin
Admin


Male Number of posts: 111
Age: 19
Location: Antipolo City
Job/hobbies: Web Page Designing, Flash Animation, Software Modification, Image Editing, Gathering Intelligence, T
Registration date: 2008-04-12

PostSubject: sample sql T_T   Fri Nov 28, 2008 2:06 pm

Option Explicit

Public LoginSucceeded As Boolean
-----------------------------------------------------
Private Sub cmdCancel_Click()
'set the global var to false
'to denote a failed login
LoginSucceeded = False
Me.Hide
End Sub
---------------------------------------------------------
Private Sub cmdOK_Click()
'check for any record, if there is no record there could be error when looping
If Data1.Recordset.RecordCount = 0 Then
MsgBox ("No recordset")
Exit Sub
End If
'check for correct username and password
Data1.Recordset.MoveFirst
Do While Not Data1.Recordset.EOF
If txtUserName = Data1.Recordset.Fields("Username") Then
If txtPassword = Data1.Recordset.Fields("Password") Then
LoginSucceeded = True
Me.Hide
Form1.Show
End If
End If
Data1.Recordset.MoveNext
Loop
If Not LoginSucceeded Then
MsgBox "Invalid UserName/Password, try again!", , "Login"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
End Sub

_________________
Back to top Go down
View user profile http://whiz.forumotion.com
 

sample sql T_T

View previous topic View next topic Back to top 
Page 1 of 1

Permissions of this forum:You cannot reply to topics in this forum
Whizard Innovation :: Whiz Tutorial :: Visual Basic Tutorial-
Post new topic   Reply to topic