Ver Mensaje Individual
  #1  
Antiguo 04-04-2012
camiz camiz is offline
Miembro
 
Registrado: ene 2012
Posts: 69
Reputación: 13
camiz Va por buen camino
Smile Login en delphi

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.

Última edición por Casimiro Notevi fecha: 04-04-2012 a las 10:37:12.
Responder Con Cita