Home » Developer & Programmer » Forms » logon
logon [message #143990] Mon, 24 October 2005 09:55 Go to next message
Sharaf
Messages: 62
Registered: September 2005
Location: U.K
Member
I am trying to create a logon table as shown below.
i created my table and form as shown below

create table login
(username varchar2(30), password varchar2(30));
insert into login values('seyi', '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 logon
where username = v_username;

if v_username =:logon.username and v_password =:logon.password then
go_block ('PATRON');
else
message('please enter a valid username and password');
end if;
end;

i compile the code with no errors and when i entered the username and password to logon. it show error as shown

FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-01403.

Please advise.
Re: logon [message #143991 is a reply to message #143990] Mon, 24 October 2005 10:03 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
ORA-1403: No data found.

Your 'SELECT INTO' statement is causing this problem. Either catch the exception via an exceptions block and 'WHEN NO_DATA_FOUND' or use a cursor and an OPEN..FETCH..CLOSE.

But why are you re-authenticating a user that has been authenticated by Oracle? Use Oracle's built-in security: a true Oracle user for each different application user. And one more thing: you might want to encrypt the data in the 'login' table if you really insist on using your own logon mechanism (but as said: I wouldn't!).

MHE
Re: logon [message #144846 is a reply to message #143991] Fri, 28 October 2005 10:26 Go to previous messageGo to next message
Sharaf
Messages: 62
Registered: September 2005
Location: U.K
Member
Please I dont understand how to go about it.

Kindly explain.
Re: logon [message #144954 is a reply to message #144846] Sat, 29 October 2005 12:03 Go to previous messageGo to next message
sachinjainonweb
Messages: 24
Registered: October 2005
Junior Member
hi


what MHE says is absolutely correct , but still if u want to proceed with ur code do this

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

begin
select username, password
into v_username, v_password
from logon
where username = v_username;
exception
when others then
null;
end;

if v_username =:logon.username and v_password =:logon.password then
go_block ('PATRON');
else
message('please enter a valid username and password');
end if;
end;


Luck Always
Re: logon [message #144975 is a reply to message #144954] Sun, 30 October 2005 08:12 Go to previous messageGo to next message
Sharaf
Messages: 62
Registered: September 2005
Location: U.K
Member
I tried it but It still does not log in a valid user name and password.

It still says please entre valid username and password.

my table is below.

table logon.

username varchar2(30)
passwords varchar2(30)

i used this code as shown belown.

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

begin
select username, passwords
into v_username, v_password
from logon
where username = v_username;
exception
when others then
null;
end;

if v_username =:logon.username and v_password =:logon.passwords then
go_block ('PATRON1');
else
message('please enter a valid username and password');
end if;
end;

Please advice.
Re: logon [message #145031 is a reply to message #144975] Mon, 31 October 2005 08:24 Go to previous message
sachinjainonweb
Messages: 24
Registered: October 2005
Junior Member
Hi

First try to put a composite unique key on logon table

alter table logon
add unique(username,passwords)

then use forms debugger on when-button-pressed to check how ur pogram is executing .

Luck Always
Previous Topic: deleteing a record from database using delete_record
Next Topic: report parameter & url error (merged)
Goto Forum:
  


Current Time: Fri Sep 20 04:40:58 CDT 2024