login screen [message #201872] |
Tue, 07 November 2006 02:54 |
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 |
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;
|
|
|
|