Visual Basic.NET - cambiar de Usuario

 
Vista:

cambiar de Usuario

Publicado por Anny (9 intervenciones) el 15/07/2014 18:20:06
Hola todos chicos y chicas
Este es el código fuente del botón aceptar de la ventana de Login de base de datos, el cual funciona perfecto.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
If cboTipoUsuario.Text = "" Then
            MsgBox("seleccionar el tipo de usuario")
            cboTipoUsuario.Focus()
            Return
        End If
 
        If txtNomUsu.Text = "" Then
            MsgBox("Falta el  Usuario ")
            txtNomUsu.Focus()
            Return
        End If
 
        If txtContrUsu.Text = "" Then
            MsgBox("Falta la contraseña  ")
            txtContrUsu.Focus()
            Return
        End If
 
 
        Dim consulta As String
 
 
        consulta = "Select * From Tbla_Usuario Where  tip_usu ='" & cboTipoUsuario.Text & "' and Nom_Usu ='" & txtNomUsu.Text & "' and Con_usu =  '" & txtContrUsu.Text & "'and act_usu = 'SI' " ' "
        'consulta = "Select * From Tbla_Usuario Where Nom_Usu ='" & txtNomUsu.Text & "' and Con_usu =  '" & txtContrUsu.Text & "'and act_usu = 'SI' " ' "
 
 
 
        comandos = New OleDb.OleDbCommand(consulta, conexion)
        adaptador.SelectCommand = comandos
        lector = comandos.ExecuteReader
 
        If lector.Read = True Then
            'NombreUsu =
            frmMenu.Show()
            Me.Hide()
 
            If cboTipoUsuario.Text = "ADMINISTRADOR(A)" Then
                frmMenu.ParámetrosToolStripMenuItem.Enabled = True
            End If
        Else
            MsgBox("Usuario O contraseña incorrectos")
            txtNomUsu.Clear()
            txtContrUsu.Clear()
            txtNomUsu.Focus()
        End If

Tengo otra ventana que se llama cambiar de Usuario, y utilizo el mismo código del botón aceptar de la ventana de Login en el botón aceptar de la ventana Cambiar Usuario, pero me da un error.

Favor de alguien ayudarme ya que tengo varios días en esto.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

cambiar de Usuario

Publicado por Pico (167 intervenciones) el 15/07/2014 19:42:18
¿Y tenemos que adivinar qué error te da?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

cambiar de Usuario

Publicado por Anny (9 intervenciones) el 15/07/2014 22:14:22
directamente no es un error, sino es que no cambia de usuario.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar