Home » Developer & Programmer » Forms » Alert problem in FORM
Alert problem in FORM [message #243978] Mon, 11 June 2007 02:51 Go to next message
lakshmi surya ram
Messages: 188
Registered: June 2006
Location: HYDERABAD
Senior Member

H Folks,
please check the following code.
I had written the same in when button pressed trigger in my login form.

Declare
username varchar2(10);
Password1 varchar2(10);
user_name varchar2(20);
pass_word varchar2(20);
a number;
begin
select user_name into username from login_user_pass
where upper(user_name) = upper(:loginmain.username)
and pass_word = :loginmain.password1;
if user_name = :loginmain.username
and pass_word = :loginmain.password1 then
--UFLAG:=show_alert('connect successful');
message('connect successful');
end if;
call_form('C:\Documents and Settings\e10093\Desktop\HR\HRVIEWREQ.fmb');

--go_item('BLOCK4.PUSH_BUTTON8');
exception
when no_data_found then
set_alert_property('Error Alert',alert_message_text,'Username and/or password are incorrect');
set_alert_property('Error Alert',title,'Error');
a :=show_alert('Error Alert');
--uflag:=show_alert('123');
message('login failed');
raise form_trigger_failure;
end;

I am using oracle 9i,forms6i

please throw light on this.

Thanks,
Surya
Re: Alert problem in FORM [message #244187 is a reply to message #243978] Mon, 11 June 2007 21:08 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

What's the problem?
Re: Alert problem in FORM [message #244195 is a reply to message #243978] Mon, 11 June 2007 22:42 Go to previous messageGo to next message
lakshmi surya ram
Messages: 188
Registered: June 2006
Location: HYDERABAD
Senior Member

Hi Wency,

1)The code is not executing properly ,eans to say its not identifying any user which already in the databse.
2) Directly it gives the message Username/password are incorrect.
thanks in advance,
Surya
Re: Alert problem in FORM [message #244200 is a reply to message #243978] Mon, 11 June 2007 23:01 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

Try to put your exception right after your query and put begin and end statement on it. It sholud be like this:
Begin
select user_name into username from login_user_pass
where upper(user_name) = upper(:loginmain.username)
and pass_word = :loginmain.password1;
exception
when no_data_found then
set_alert_property('Error Alert',alert_message_text,'Username and/or password are incorrect');
message('login failed');
raise form_trigger_failure;
end;

if user_name = :loginmain.username
and pass_word = :loginmain.password1 then
message('connect successful');
call_form('C:\Documents and Settings\e10093\Desktop\HR\HRVIEWREQ.fmb');
end if;
Re: Alert problem in FORM [message #244218 is a reply to message #243978] Tue, 12 June 2007 01:22 Go to previous message
lakshmi surya ram
Messages: 188
Registered: June 2006
Location: HYDERABAD
Senior Member

thanks wency
post you soon on my mext effort
Previous Topic: Installation errors: Developer 2000 & Oracle on one machine (merged)
Next Topic: fields to be disabled whenever enterted from login form
Goto Forum:
  


Current Time: Fri Dec 09 09:45:41 CST 2016

Total time taken to generate the page: 0.09188 seconds