VERSION 5.00
Begin VB.Form frmLogin 
   Appearance      =   0  'Flat
   BackColor       =   &H80000004&
   Caption         =   "Logon Information "
   ClientHeight    =   885
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4095
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   885
   ScaleWidth      =   4095
   StartUpPosition =   2  'CenterScreen
   Begin VB.Frame Frame1 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   915
      Left            =   30
      TabIndex        =   0
      Top             =   -75
      Width           =   4035
      Begin VB.CommandButton cmdcancel 
         Cancel          =   -1  'True
         Caption         =   " &Cancel"
         Height          =   315
         Left            =   2895
         TabIndex        =   4
         Top             =   495
         Width           =   1000
      End
      Begin VB.CommandButton cmdlogin 
         Caption         =   " &Login"
         Default         =   -1  'True
         Height          =   315
         Left            =   2895
         TabIndex        =   3
         Top             =   180
         Width           =   1000
      End
      Begin VB.TextBox txtPass 
         Height          =   315
         IMEMode         =   3  'DISABLE
         Left            =   1410
         MaxLength       =   250
         PasswordChar    =   "*"
         TabIndex        =   2
         Top             =   510
         Width           =   1215
      End
      Begin VB.TextBox txtLogin 
         Height          =   315
         Left            =   1425
         MaxLength       =   250
         TabIndex        =   1
         Top             =   180
         Width           =   1200
      End
      Begin VB.Label Label2 
         Caption         =   " Password"
         Height          =   300
         Left            =   120
         TabIndex        =   6
         Top             =   555
         Width           =   1020
      End
      Begin VB.Label Label1 
         Caption         =   " Login Name"
         Height          =   300
         Left            =   135
         TabIndex        =   5
         Top             =   225
         Width           =   1005
      End
   End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
 End
End Sub

Private Sub cmdlogin_Click()
 Dim stPass As String
 Dim i As Integer
 Dim LoginSucceeded  As Boolean
 Dim con As ADODB.Connection
 Dim record As ADODB.Recordset
  
 Set record = New ADODB.Recordset
 Set con = modConn.getConnection
 
 record.Open "select login_name, password, user_id , role from users", con, adOpenDynamic
    
 stLogin = txtLogin.Text
 stPass = txtPass.Text

 While Not record.EOF
     If (stLogin = record.Fields(0) And stPass = record.Fields(1)) Then
        stRole = record.Fields("role") & ""
       ' modFunc.fnDisableMenu
        LoginSucceeded = True
        mdiMenu.Show
        Unload Me
        Exit Sub
     End If
     record.MoveNext
 Wend
 
 If LoginSucceeded = False Then
     MsgBox "Invalid Password, try again!", vbCritical, "Invalid Login"
     txtPass.SetFocus
     SendKeys "{Home}+{End}"
 End If
End Sub

Private Sub Form_Load()
 Me.Left = 3850
 Me.Top = 5650
 modConn.openConnection
End Sub

Private Sub Form_Resize()
    Me.Height = 1290
    Me.Width = 4215
End Sub

Private Sub Form_Unload(Cancel As Integer)
 Unload frmSplash
End Sub

