Ver Mensaje Individual
  #6 (permalink)  
Antiguo 15/09/2011, 14:59
Avatar de lokoman
lokoman
 
Fecha de Ingreso: septiembre-2009
Mensajes: 502
Antigüedad: 14 años, 7 meses
Puntos: 47
Respuesta: Formulario de login con user y pass

Hola!
Que bueno que lo lograste resolver, aqui otra forma mas reducida:

Código vb:
Ver original
  1. '
  2. Private Sub cmdAceptar_Click()
  3.    Dim rstDatos as ADODB.Recorset
  4.    Dim strSelect as string
  5.  
  6.    Set rstDatos = new ADODB.Recorset
  7.    rstSelect="SELECT * FROM TABLA_USUARIOS WHERE USERNAME='" & trim(txtUsuarios.Text) & "'"
  8.    rstDatos.Source=strSelect
  9.    rstDatos.Open, CONEXION_BD
  10.  
  11.    If rstDatos.EOF = False Then
  12.       If trim(txtPassword.text)=trim(rstDatos!PASS) then
  13. 'TODO ESTA CORRECTO!!!
  14.         Configurador.Show        
  15.       Else
  16.          MsgBox "El Password está incorrecto!!", vbInformation
  17.          txtPassword.SetFocus
  18.       End If
  19.    Else
  20.       MsgBox "El usuario no existe!!", vbInformation
  21.       txtUsuarios.SetFocus
  22.    End If
  23. End Sub