Fórum Problemas no login com Delphi XE #418568
15/06/2012
0
Estou tendo problemas com o acesso, quando clico no botão apos compilar aparece a seguinte mensagem:
---------------------------
Confere
---------------------------
ADOQuery1: Parameter usuario not found.
---------------------------
OK
---------------------------
segue tambem como estar no botão:
procedure TAcesso.bntokClick(Sender: TObject);
begin
dm.ADOQuery1.SQL.Clear;
dm.ADOQuery1.SQL.Text := select * from usuarios where usuario=:edusuario and senha=:edsenha;
dm.ADOQuery1.Parameters.ParamByName(usuario).Value := edusuario.Text;
dm.ADOQuery1.Parameters.ParamByName(Senha).Value := edsenha.Text;
dm.ADOQuery1.Open;
if not (dm.ADOQuery1.IsEmpty) then
ShowMessage(Acesso autorizado!)
else
ShowMessage(Sai pra lá, você não tem acesso.);
end;
---------------------------
Confere
---------------------------
ADOQuery1: Parameter usuario not found.
---------------------------
OK
---------------------------
segue tambem como estar no botão:
procedure TAcesso.bntokClick(Sender: TObject);
begin
dm.ADOQuery1.SQL.Clear;
dm.ADOQuery1.SQL.Text := select * from usuarios where usuario=:edusuario and senha=:edsenha;
dm.ADOQuery1.Parameters.ParamByName(usuario).Value := edusuario.Text;
dm.ADOQuery1.Parameters.ParamByName(Senha).Value := edsenha.Text;
dm.ADOQuery1.Open;
if not (dm.ADOQuery1.IsEmpty) then
ShowMessage(Acesso autorizado!)
else
ShowMessage(Sai pra lá, você não tem acesso.);
end;
Tiago Santos
Curtir tópico
+ 0
Responder
Posts
15/06/2012
Tiago Santos
Resolvi assim:
procedure TAcesso.bntokClick(Sender: TObject);
begin
dm.ADOQuery1.SQL.Clear;
dm.ADOQuery1.SQL.Text := select * from usuarios where usuario=:edusuario and senha=:edsenha;
dm.ADOQuery1.Parameters.ParamByName(edusuario).Value := edusuario.Text;
dm.ADOQuery1.Parameters.ParamByName(edSenha).Value := edsenha.Text;
dm.ADOQuery1.Open;
if not (dm.ADOQuery1.IsEmpty) then
ShowMessage(Acesso autorizado!)
else
ShowMessage(Sai pra lá, você não tem acesso.);
A duvida é a seguinte o campo senha nao tem valores em texto, ele é criptografado , tem alguma coisa que eu possa fazer facilmente ou é complicado. testei copiando o valor criptografado e colando e roda aqui perfeitamente, mas quero digitar o texto referente ao valor criptografado
procedure TAcesso.bntokClick(Sender: TObject);
begin
dm.ADOQuery1.SQL.Clear;
dm.ADOQuery1.SQL.Text := select * from usuarios where usuario=:edusuario and senha=:edsenha;
dm.ADOQuery1.Parameters.ParamByName(edusuario).Value := edusuario.Text;
dm.ADOQuery1.Parameters.ParamByName(edSenha).Value := edsenha.Text;
dm.ADOQuery1.Open;
if not (dm.ADOQuery1.IsEmpty) then
ShowMessage(Acesso autorizado!)
else
ShowMessage(Sai pra lá, você não tem acesso.);
A duvida é a seguinte o campo senha nao tem valores em texto, ele é criptografado , tem alguma coisa que eu possa fazer facilmente ou é complicado. testei copiando o valor criptografado e colando e roda aqui perfeitamente, mas quero digitar o texto referente ao valor criptografado
Responder
Gostei + 0
16/06/2012
Bruno Leandro
Ola tiago, uma forma de resolver eh só usar no where o usuario e voce conferir a senha passar da seguinte forma
procedure TAcesso.bntokClick(Sender: TObject);
begin
dm.ADOQuery1.SQL.Clear;
dm.ADOQuery1.SQL.Text := select * from usuarios where usuario=:edusuario;
dm.ADOQuery1.Parameters.ParamByName(edusuario).Value := edusuario.Text;
dm.ADOQuery1.Open;
if dm.ADOQuery1.fieldbyname(senha).asstring = MeuCriptografa(edsenha.Text) then
ShowMessage(Acesso autorizado!)
else
ShowMessage(Sai pra lá, você não tem acesso.);
procedure TAcesso.bntokClick(Sender: TObject);
begin
dm.ADOQuery1.SQL.Clear;
dm.ADOQuery1.SQL.Text := select * from usuarios where usuario=:edusuario;
dm.ADOQuery1.Parameters.ParamByName(edusuario).Value := edusuario.Text;
dm.ADOQuery1.Open;
if dm.ADOQuery1.fieldbyname(senha).asstring = MeuCriptografa(edsenha.Text) then
ShowMessage(Acesso autorizado!)
else
ShowMessage(Sai pra lá, você não tem acesso.);
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)