creating a log-in screen in oracle forms 9i

Hi,

I have not had much experience in developing forms in oracle and wondered if anyone could advise me on how to create a log-on screen for a set of users to be able to put their username and passwords access the main page of my solution.  
Is there a built-in facility in oracle forms itself, do I have to create a table with names and passwords and just build a form which acts a log-on screen?

Can anyone help please.
thanks
cassiusduke
cassiusdukeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Helena Markováprogrammer-analystCommented:
You can use default Forms logon screen. It is displayed automatically when a user is not connected to the database or you can invoke it by using LOGON_SCREEN.
You can also built your own logon screen - see LOGON_SCREEN, LOGON, LOGOUT built-ins with examples in the on-line help. There is no need of building the table with names and passwords as you will see in the examples.
0
bochgochCommented:
Depends to a degree what you want to do with security....

If you need to set up types of users with differing access to parts of your application (i.e. administrator, supervisor, manager, operator etc.) then to ensure the flexibility you want you may need to develop your table as you suggest. If you have a simple need to login and create a database connection then Forms logon screen will handle this.

You'll need to consider how users are added to the system and who'll administer it -- if each user has their own id, depending on which option you take someone will need to create a database user (through your security administrators) or enter the user into your table (which can be done in the application by a supervisor / manager).

...it's a question of security, administration of security and application requirements...
0
sujit_kumarCommented:
>>do I have to create a table with names and passwords and just build a form which acts a log-on screen?
  Yes you will have to do it. Store the password in encrypted format. Then compare the password that user enters through the login screen with your password stored in DB. if correct then allo otherwise exit/show error.


You can also Active/Inactive a user and store the same as a flag in DB. Don't allow Inactive users.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

cassiusdukeAuthor Commented:
I did build a table like the following and a form which acts as a log-on screen but the code I wrote doesnot work properly.

drop table logon;
create table login
(username varchar2(30), password varchar2(30));
insert into login values('Bob', 'password');
insert into login values('Robert', 'password');

in the form under the when mouse click trigger
I typed in the following

declare
v_username varchar2(30);
v_password varchar2(30);

begin
select username, password
into v_username, v_password
from login
where username = v_username;

if v_username = 'bob and v_password = 'password' then
        open_form('e:\forms\workingforms\latest\studentopensupport2.fmx');
else
message('please enter a valid username and password');
end if;
end;

but this doesnot work can nayone tell me where am I going wrong?
thanks
cassiusduke
0
Helena Markováprogrammer-analystCommented:
What does it mean "this does not work" ?
I cannot see in your code who is logged - what is the value of v_username ?
0
psreedharCommented:
username password validation thru table is not good practice . in your form
e:\forms\workingforms\latest\studentopensupport2.frm  

have a On-Logon trigger at form level  with following code .

-- code for On-Logon at Form Level

DECLARE

usname VARCHAR2(30);

paswd VARCHAR2(30);

constn VARCHAR2(30);

upc     VARCHAR2(200);

connected BOOLEAN := FALSE;

tries NUMBER := 3;

PROCEDURE get_conn_info is

BEGIN

usname := GET_APPLICATION_PROPERTY(USERNAME);

paswd := GET_APPLICATION_PROPERTY(PASSWORD);

constn := GET_APPLICATION_PROPERTY(CONNECT_STRING);

END;

BEGIN

get_conn_info;

IF usname IS NOT NULL THEN

LOGON(usname, paswd||'@'||constn, FALSE);

IF FORM_SUCCESS THEN /* Successful logon */

connected := TRUE;

END IF;

END IF;

WHILE connected = FALSE and tries > 0 LOOP

upc := usname||paswd||constn;

LOGON_SCREEN;

get_conn_info;

IF upc = usname||paswd||constn THEN

EXIT;

END IF;

LOGON(usname, paswd||'@'||constn, FALSE);

IF FORM_SUCCESS THEN /* Successful logon */

connected := TRUE;

END IF;

tries := tries - 1;

END LOOP;

IF NOT connected THEN

RAISE FORM_TRIGGER_FAILURE;

END IF;

END;

0
PAQ_ManCommented:
PAQed with no points refunded (of 30)

PAQ_Man
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java App Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.