Ver Mensaje Individual
  #6 (permalink)  
Antiguo 15/10/2012, 11:39
Avatar de thegodinez
thegodinez
 
Fecha de Ingreso: octubre-2010
Ubicación: Culiacán, Sinaloa
Mensajes: 54
Antigüedad: 13 años, 7 meses
Puntos: 5
Respuesta: login en vb 2008

Si manejas diversos tipos de usuarios, en tu tabla "tbl_usuarios" debes de tener un campo llamado "tipo_usuario".

Entonces te propongo cambiar tu instrucción sql por:

select usuario, contrasenia, tipousuario from tbl_usuarios where usuario='" & txt_usuario.Text & "' and contrasenia='" & txt_contrasenia.Text & "'"

y agregar otra restriccion aqui abajo

Código:
If txt_usuario.Text = fila!usuario And txt_contrasenia.Text = fila!contrasenia Then : Hide() : Opciones.Show() : txt_usuario.Text = "" : txt_contrasenia.Text = "" : 

SELECT CASE fila!tipo_usuario
CASE 'A'
MsgBox "Administrador"
CASE ELSE
MsgBox "No Administrador"

End If

Última edición por thegodinez; 15/10/2012 a las 11:47