Create table with two columns (username , password )
CREATE TABLE PASSWORD
(USER_ID NUMBER(3) CONSTRAINT PASSWORD_USER_ID_PK PRIMARY KEY,
PASSWORD VARCHAR2(20) NOT NULL);
INSERT INTO PASSWORD (USER_ID,PASSWORD)
VALUES (1,100);
INSERT INTO PASSWORD (USER_ID,PASSWORD)
VALUES (2,200);
Second:
Create Forms Look Like the Following :
Third :
You have two way to check Username, password :
Using Trigger in When_button_presses
BEGIN
SELECT USER_ID
INTO :GLOBAL.USER_ID
FROM PASSWORD
WHERE USER_ID = :LOGIN.TI_USER_ID
AND PASSWORD= :LOGIN.TI_PASSWORD;
GO_BLOCK(‘PASSWORD’);
EXCEPTION
WHEN NO_DATA_FOUND THEN
:GLOBAL.COUNT := :GLOBAL.COUNT + 1;
IF :GLOBAL.COUNT = 1 THEN
MESSAGE(‘wrong’);
MESSAGE(‘wrong’);
ELSIF
:GLOBAL.COUNT = 2 THEN
MESSAGE(‘wrong’);
MESSAGE(‘wrong’);
ELSIF
:GLOBAL.COUNT = 3 THEN
EXIT_FORM;
END IF;
END;
there’s million way to do this . this is the easy one
you Can Create procedure inside Program_unit Name it Vaildation_pass.
But Inside When_button_pressed Write procedure name .
Vaildation_pass
PROCEDURE VALIDATION_PASS IS
BEGIN
SELECT USER_ID
INTO :GLOBAL.USER_ID
FROM PASSWORD
WHERE USER_ID = :LOGIN.TI_USER_ID
AND PASSWORD= :LOGIN.TI_PASSWORD;
GO_BLOCK(‘PASSWORD’);
EXCEPTION
WHEN NO_DATA_FOUND THEN
:GLOBAL.COUNT := :GLOBAL.COUNT + 1;
IF :GLOBAL.COUNT = 1 THEN
MESSAGE(wrong’);
MESSAGE(wrong’);
ELSIF
:GLOBAL.COUNT = 2 THEN
MESSAGE(wrong’);
MESSAGE(wrong’);
ELSIF
:GLOBAL.COUNT = 3 THEN
EXIT_FORM;
END IF;
END;
Notice that above code contain global_variable So We need to add Trigger (form_level)/When_new_forms_instance.
Inside this trigger add :GLOBAL.COUNT = 0
Subject Written by Arefa in Arabic Review it here
Thank You
Osama Mustafa
very nice
LikeLike
this is very nice but …now i want to change a user name and password , or create another user what should be done
LikeLike
thats very good for single user now i want to create another user or change the password what should be done
LikeLike
i don' think login screen will allow for more than one user to log in … its always for single user this or please clarify your point
LikeLike
It isnt working…..its giving an error bad bind variable
LikeLike
hi Frankie Post error like you see it , and when you press double click on the error it will automatically direct you to the error.
LikeLike
Asalamu Alkaikum bhaaialhamduillahits working finei use your query with my password table thank u i want to friend ship with u bhaaimy email is basharmits@gmail.com
LikeLike
Your welcome You can check my social media i posted on my blog 🙂
LikeLike
kindly elaborate this more.Notice that above code contain global_variable So We need to add Trigger (form_level)/When_new_forms_instance.Inside this trigger add :GLOBAL.COUNT = 0and about the logout code? 🙂
LikeLike
it is not working, it always gives me the same error: “wrong” :(((((
LikeLike
always runs the exception even if the condition is correct
LikeLike
I'm new to Oracle Forms 10g. When I create a data block based on a table using Data Block Wizard, the block's Query Data Source Columns property is automatically populated with column definition entries corresponding to the columns of the base table.I tried making changes to these entries, for example by changing the data types to wrong data types or even deleting them, and I found that those changes had no effect on the block at all. The form was still working as I wanted. Please explain what is exactly the role of the block's Query Data Source Columns property. Thank you very much.p.s: The F1 key help says “The Query Data Source Columns property is valid only when the Query Data Source Type property is set to Table, Sub-query, or Procedure”. So, please explain in each context of Query Data Source Type.
LikeLike
i have an error it says”Error 49 line 5 column 19 bad bind variable 'LOGIN.TI_USER_ID'Error 49 line 6 column 19 bad bind variable'LOGIN.TI_PASSWORD'can you help me sir?
LikeLike
i have an error it says”Error 49 line 5 column 19bad bind variable 'LOGIN.TI_USER_ID'Error 49 line 6 column 19bad bind variable'LOGIN.TI_PASSWORD'panu to ayusin ate?
LikeLike
declareuname login.username%type;pass login.password%type;cursor mycur is select username,password from login;begin open mycur; loop fetch mycur into uname, pass; if :username=uname and :password= pass then message('valid user'); exit when mycur%found; elsif mycur%notfound then message ('invalid user'); exit when mycur%notfound; end if; end loop; close mycur;end; error login.username must be declared
LikeLike
Helpful tips. thanks
LikeLike
brother i have an error frm40104 no such bock pwd please you help me should i do?
LikeLike
This comment has been removed by the author.
LikeLike
This comment has been removed by the author.
LikeLike
This comment has been removed by a blog administrator.
LikeLike