VERSION 5.00
Begin VB.Form FSEGURIDAD 
   Caption         =   "Seguridad"
   ClientHeight    =   2655
   ClientLeft      =   60
   ClientTop       =   5340
   ClientWidth     =   4350
   LinkTopic       =   "Form1"
   ScaleHeight     =   2655
   ScaleWidth      =   4350
   Begin VB.CommandButton CMD_CANCELAR 
      Cancel          =   -1  'True
      Caption         =   "Cancelar"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2280
      TabIndex        =   3
      Top             =   1800
      Width           =   1935
   End
   Begin VB.CommandButton CMD_ACEPTAR 
      Caption         =   "Aceptar"
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   120
      TabIndex        =   2
      Top             =   1800
      Width           =   1815
   End
   Begin VB.TextBox txt_password 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1680
      PasswordChar    =   "*"
      TabIndex        =   1
      Text            =   "123"
      Top             =   960
      Width           =   2295
   End
   Begin VB.TextBox txt_usuario 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1680
      TabIndex        =   0
      Text            =   "DUFFGGU"
      Top             =   240
      Width           =   2295
   End
   Begin VB.Label Label2 
      Caption         =   "Password:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   360
      TabIndex        =   5
      Top             =   960
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "Usuario:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   600
      TabIndex        =   4
      Top             =   360
      Width           =   975
   End
End
Attribute VB_Name = "FSEGURIDAD"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub CMD_ACEPTAR_Click()
Dim qwerty As String
Dim ytrewq As String
Dim cadena As String
Dim rs_usuarios As ADODB.Recordset
Dim clave As String
qwerty = UCase(Trim(txt_usuario.Text))
ytrewq = UCase(Trim(txt_password.Text))
If Len(qwerty) = 0 Then
    MsgBox ("Debe ingresar un usuario")
    txt_usuario.SetFocus
    Exit Sub
End If
If Len(ytrewq) = 0 Then
    MsgBox ("Debe ingresar un password")
    txt_password.SetFocus
    Exit Sub
End If
'encriptar password
Set rs_usuarios = New Recordset
cadena = "select userid,password from se_userrec where userid='" + qwerty + "'"
rs_usuarios.Open cadena, cnxprueba, adOpenStatic
If rs_usuarios.EOF Then
    MsgBox ("No existe Usuario")
    txt_usuario.SetFocus
    Exit Sub
Else
    clave = Trim(rs_usuarios!Password)
    If clave = ytrewq Then
        gcuserid = qwerty
        MDIFconfiguracion.Show
    Else
    MsgBox (clave)
        MsgBox (ytrewq)
        MsgBox ("Clave Incorrecta")
        txt_password.SetFocus
        Exit Sub
        
        
    End If
End If
Unload Me
End Sub

Private Sub CMD_CANCELAR_Click()
cnxprueba.Close
Set cnxprueba = Nothing
End
End Sub


