VERSION 5.00
Begin VB.Form FrmLogin 
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   3615
   ClientLeft      =   15
   ClientTop       =   15
   ClientWidth     =   5565
   ControlBox      =   0   'False
   LinkTopic       =   "Form9"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "FrmLogin.frx":0000
   ScaleHeight     =   3615
   ScaleWidth      =   5565
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton Command1 
      BackColor       =   &H00FFFFFF&
      Height          =   450
      Left            =   480
      Picture         =   "FrmLogin.frx":F2E0
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   2880
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      BackColor       =   &H00FFFFFF&
      Height          =   450
      Left            =   1800
      Picture         =   "FrmLogin.frx":10F42
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   2880
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      IMEMode         =   3  'DISABLE
      Index           =   1
      Left            =   1560
      MaxLength       =   39
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   1440
      Width           =   2535
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      Index           =   0
      Left            =   1560
      MaxLength       =   39
      TabIndex        =   0
      Top             =   960
      Width           =   2535
   End
End
Attribute VB_Name = "FrmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
V_Vista = "SELECT    CodUsua, Descrip, EMail, movil  FROM    SSUSRS where len(email)>1 and email='" & Text1(1).Text & "' AND  codusua='" & Text1(0).Text & "'"
Set rs4 = New ADODB.Recordset
    With rs4
        .CursorLocation = adUseClient
        .CursorType = adOpenStatic
        .LockType = adLockBatchOptimistic
        .Open V_Vista, CN, , , 1
    End With
If rs4.BOF = True And rs4.EOF = True Then
    MsgBox ("Usuario o Contraseņa Invalida")
    Text1(0).Text = ""
    Text1(1).Text = ""
    Text1(0).SetFocus
    Exit Sub
Else
    If rs4.Fields("movil").Value <= "6" Then
    vCODVEND = rs4.Fields(0).Value
    vDesVend = rs4.Fields(1).Value
    FrmLogin.Visible = False
    Form1.Show
    Else
        MsgBox ("Nivel de Acceso No Permitido")
        Text1(0).Text = ""
        Text1(1).Text = ""
        Text1(0).SetFocus
        Exit Sub
    End If
    If rs4.Fields("movil").Value = "1" Then
        Form1.Combo2.Enabled = True
    Else
        Form1.Combo2.Enabled = False
    End If
    
End If
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Form_Activate()
FrmLogin.Text1(0).SetFocus
End Sub

Private Sub Form_Load()
CONEXION_D = "FILE NAME=" & App.Path & "\CONEXION.dsn"
CN.Open CONEXION_D
'CONEXION_D = "FILE NAME=" & App.Path & "\CONEXION KDY.dsn"
'CN.Open CONEXION_D
'CONEXION_D = "FILE NAME=" & App.Path & "\CONEXION.dsn"
'CN2.Open CONEXION_D
 
End Sub

Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 13 Then
    If Index = 0 Then
        Text1(1).SetFocus
    Else
        Command1.SetFocus
    End If
End If
End Sub
