Home » Developer & Programmer » Forms » Help on Logon
Help on Logon [message #305089] Sat, 08 March 2008 06:11 Go to next message
*munnabhai*
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
Hi guyz,

I have a table Logon
 Name         Null?    Type
------------ -------- ----------------------------
 USRNM                 VARCHAR2(15) UNIQUE
 PASWD        NOT NULL VARCHAR2(15)
 STATUS                CHAR(1)
---------------------------------------------------

Data is like this
USRNM           PASWD           S
--------------- --------------- -
TEST            TEST            Y
ADMIN           ADMIN           N


im trying the procedure below on When_button_trigger

when im logging in from the logon form the status should be 'Y'
i mean it should be update the logon table status to 'Y'

and when im exit from main windows the logon status should be 'N'

but it was not update some problem can anyone explain why?

below is the trigger im using?

just i wanna to updat the status let me know how ?
DECLARE 
	A VARCHAR2(15);
	B VARCHAR2(15);
	C CHAR(1);
BEGIN

	SELECT USRN,PASWD,STATUS INTO A,B,C FROM LOGON
	WHERE USRNM=:LOGON.USRNM;
	IF A=:USRNM AND B=:PASWD AND  C='N' THEN --->(I WANNA TO CHECK HERE THE STATUS OF THE TABLE AND UPDATE THE TABLE TO 'Y')
           UPDATE LOGON SET STATUS='Y' WHERE USRNM=A;
           COMMIT_FORM;
 	   Message('You have no unsaved changes outstanding.'); 
 	   CALL_FORM(GETPATH||'MAIN_MENU',HIDE); --> (IF SESSION IS TRUE THEN CALL MAIN_MENU)

	   CLEAR_RECORD;
	   RAISE FORM_TRIGGER_FAILURE;
	ELSIF C='Y' THEN
		MESSAGE('You have already logged on at another Machine !!!!');
		ELSE
		MESSAGE('Invalid Password or Username !!!');
		GO_ITEM('LOGON.USRNM');
	END IF;
	--	END IF;
	EXCEPTION
		WHEN NO_DATA_FOUND THEN 
		MESSAGE('Invalid Username or Password!!!');
END;


IS THERE SOMETHING WRONG IN THIS TRIGGER LET ME KNOW GUYZ HOW TO UPDATE THE RECORD WITH THIS TRIGGER?
THE ERROR IS (FRM-40735: WHEN BUTTON PRESSED trigger raised unhandled exception 0ra-01403)

Request to all please help me to get out in this....


Regards

EDITED by LF: added [code] tags in order to improve readability. Next time, please, properly format the code and use [code] tags yourself.

[Updated on: Sat, 08 March 2008 10:35] by Moderator

Report message to a moderator

Re: Help on Logon [message #305097 is a reply to message #305089] Sat, 08 March 2008 07:25 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
Your select into clause does not return any values.
Check whether the username you are login in the form actually has any data in the database
Re: Help on Logon [message #305113 is a reply to message #305089] Sat, 08 March 2008 10:31 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This
*munnabhai*
	EXCEPTION
		WHEN NO_DATA_FOUND THEN 
		MESSAGE('Invalid Username or Password!!!');


doesn't go together with
*munnabhai*
WHEN BUTTON PRESSED trigger raised unhandled exception 0ra-01403)

So, either you didn't post actual code you use, or this wasn't the error you got.

Also, take some time to get familiar with rules people should follow while participating discussions on the OraFAQ Forum. These are written in the Guide (especially pay attention to code formatting).
Re: Help on Logon [message #305148 is a reply to message #305089] Sun, 09 March 2008 04:54 Go to previous messageGo to next message
*munnabhai*
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
THANKS ALLL

ITS SOLVED..............

great FORUM....

REGARDS

MUNNABHAI
Re: Help on Logon [message #305162 is a reply to message #305148] Sun, 09 March 2008 15:46 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Would you mind to post the solution so that other forum members might benefit from it?
Previous Topic: Open cash drawer using oracle developer 6i
Next Topic: Window is not closing
Goto Forum:
  


Current Time: Sun Feb 09 22:11:01 CST 2025