Home » Developer & Programmer » Forms » login screen
login screen [message #201872] Tue, 07 November 2006 02:54 Go to next message
zaghloul
Messages: 9
Registered: October 2006
Junior Member
we are trying to build a log in screen for the users which performs the following :
checks the user name and password and if correct connects them and if incorrect an alert appears.
we are using the application form builder 9i. the code we used is as follows :


Declare
user_name varchar2(10);
PaSSWORD VaRCHaR2(10);

a number;

begin
select users.user_name
into :global.dummy
from users
where user_name = :users.user_name
and password = :users.password;
if user_name = :users.user_name
and password = :users.password
then a:=show_alert ('connect_successful');

message('Username and password are correct - go to main_menue');
go_item('a_block_on_another_canvas.first_item');

else

a:=show_alert ('failed ');
message('Username and/or password are incorrect');
raise form_trigger_failure;


end if;
end;

please if there is something wrong in the code help us because it doesnt want to work. it gives us an error frm-40735
thanks
Re: login screen [message #201892 is a reply to message #201872] Tue, 07 November 2006 04:22 Go to previous messageGo to next message
magnetic
Messages: 324
Registered: January 2003
Senior Member

the code should be

Declare
user_name varchar2(10);
PaSSWORD VaRCHaR2(10);
a number;

begin
select username
into user_name
from dba_users
where upper(username) = upper(:users.user_name)
and password = :users.password;

if user_name = :users.user_name
and password = :users.password then
a:=show_alert ('connect_successful');
message('Username and password are correct - go to
main_menue');
go_item('a_block_on_another_canvas.first_item');
end if;
exception
when no_data_found then
a:=show_alert ('failed ');
message('Username and/or password are incorrect');
raise form_trigger_failure;
end;
Re: login screen [message #202017 is a reply to message #201892] Tue, 07 November 2006 21:28 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Come on guys - use the 'code' tags!!

David
Previous Topic: No of detail block records.
Next Topic: FROM clause query (Database Block)
Goto Forum:
  


Current Time: Thu Dec 08 18:26:15 CST 2016

Total time taken to generate the page: 0.10943 seconds