I have 2 questions on a single topic. The following function works on other developments normally.
Public Function VerificaUsr(ID As String, Psw As String) As Boolean
Dim Rslt As Boolean
Rslt = Conectar()
If Not Rslt Then Exit Function
DBCmd.CommandText = "SELECT * FROM User WHERE Login_Name='" + ID + "' And Password='" + Psw + "'"
DBCmd.Connection = Conn
Reader = DBCmd.ExecuteReader
If Reader.Read Then
Return True
Else
nEnt = nEnt + 1
If nEnt > 2 Then
MessageBox.Show("Ha excedido los intentos de Acceso!", "Acceso sistema de Transporte", MessageBoxButtons.OK, MessageBoxIcon.Information)
Application.Exit()
End If
MessageBox.Show("ID de usuario y/o clave de acceso incorrectos", "Acceso sistema de Transporte", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return False
End If
Conn.Close()
End Function
As you can see it is to guarantee that the user who tries to enter the system is valid. But in a new development (With the same characteristics as others - Same computer and same version of Access) I get the following error:
Syntax error in the FROM clause
in line Reader = DBCmd.ExecuteReader
and in Access that instruction works well, what do you think happens?
The other: The "End Function" tells me that the function does not return a value.
I appreciate any help or idea.