Hola amigos nuevamente por aqui, buscando ayuda nesecito hacer un Login para el ingreso a una aplicacion con base de datos firebird he probado varios metodos y no funciona, la base de datos es firebird y consta asi.
Código SQL
[-]CREATE TABLE USUARIO
(
CODUSUARIO Integer NOT NULL,
NOMBRE Char(50),
DIRECCION Char(70),
USUARIO Char(20) NOT NULL,
CLAVE Char(20) NOT NULL,
PRIMARY KEY (CODUSUARIO)
);
lo que quiero es validar el Usuario y clave para luego ingresar al sistema he estado probando este codigo con la ayuda de unos Tutoriales
pero no funciona.
la consulta del IBQuery es esta
Código SQL
[-]select CODUSUARIO, USUARIO, CLAVE from USUARIO WHERE CODUSUARIO=:USER
Código Delphi
[-]begin
frmConeccion.Login.Params.ParamByName('USER').Value:= txt_usuario.Text;
frmConeccion.Login.Active:= True;
If frmConeccion.Login.RecordCount < 1 then
begin
Cuenta := Cuenta + 1;
Application.MessageBox('Usuario no encontrado', 'Atención', MB_ICONINFORMATION or MB_OK);
txt_usuario.Text := '';
txt_clave.Text := '';
frmConeccion.Login.Active := False;
If Cuenta = 3 then Close;
end
else
If txt_clave.Text = frmConeccion.LoginCLAVE.AsString then
Begin
frmPrincipal.Show;
frmConeccion.Login.Active := False;
frmLogin.Visible:= False;
end
else
begin
Cuenta := Cuenta + 1;
Application.MessageBox('Clave incorrecta, intente de nuevo', 'Atención', MB_ICONERROR or MB_OK);
txt_clave.Text := '';
frmConeccion.Login.Active := False;
If Cuenta = 3 then Close;
end;
a ver si me dan una manito se lo agradecere.