login and change message location
TasneemApr 3 2012 — edited Apr 9 2012Hi all,
I want to display an error msg when the user enters user name or pwd incorrect, and would like to change the location of the error msg on the screen , here is the code::
declare
cursor c1 is select user_name, user_password from Users;
c1_user_name Users.user_name%type;
c1_user_password Users.user_password%type;
begin
:global.count:=0;
open c1;
first_record;
loop
fetch c1 into c1_user_name,c1_user_password;
exit when c1%notfound;
if :user_name= c1_user_name and :user_password= c1_user_password then
new_form('MAIN_MENU.fmx');
else
begin
message('the user name or password is incorrect');
message('the user name or password is incorrect');
:global.count := nvl(:global.count,0)+1; --counting # of login trials
end;
end if;
if :global.count =3 then
begin
clear_block ('USERS.fmx');
exit_form(NO_COMMIT,NO_VALIDATE);
end;
end if;
end loop;
close c1;
end;
1) Is it correct?? because it doesn't close the form when count reaches 3
2) how to change the location of the msg because it is not displayed completely???
Thank u,
Tasneem