?
Solved

Menu Login

Posted on 2004-04-17
3
Medium Priority
?
486 Views
Last Modified: 2012-08-14
Hi,

 Can anyone tell me how can i do some error checking on a login command button?
what i need to do is just check if the login is good or not.it should trigger the display of an ALERT with a message if the login information is incorrect.

Another question is, if i retreive values from the data base how can i let the radio button or a combo box change it's state to the corresponding value.
0
Comment
Question by:Dj_maj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 8

Accepted Solution

by:
annamalai77 earned 420 total points
ID: 10848291
hi there

just follow the steps given. i assume that u know a bit about forms

Alert Creation.
1. create an alert (say show_message as the alert name).
2. from the alert properties type Error Message in the title row
3. Type message in the Message Row
4. Choose Note in the Alert Style
5. Type OK in the Button 1 Lable
6. Choose Button 1 in the  Default Alert Button row.
7. create a Program Unit with the same name as ur alert name ( same name as ur alert name is for convenience purpose).
8. in the program unit type the following code
PROCEDURE show_message( msg VARCHAR2 )IS
   al_id Alert;
   which_Button number;
BEGIN
   al_id := FIND_ALERT('show_message');
   CHANGE_ALERT_MESSAGE( al_id, msg );
   which_Button := SHOW_ALERT(al_id );
END;

Alert Display when wrong user.

I assume that ur username and password is stored in ur custom table.

when the user enters his login id and password and then presses the login button

in the when-button-pressed of the login button type the following code
declare
cnt number := 0;
begin
   select count(*)
   into cnt
   from <table_name>
   where loginid = ::block_name.loginid field_name>;

   if cnt = 0 then
      show_message('Invalid Login Id');
      raise form_trigger_failure;
  end if;
end;

this will display the alert show_message we have created.

regarding ur second question ie changing the value of ur radio button, u should remember one thing that is the radio button data type should be of the same data type as ur database fields data type.

once u have selected the value from database just store the value in a temporary variable as assign to the radio button value like the statement given below

SET_RADIO_BUTTON_PROPERTY
  (item_name    VARCHAR2,
   button_name  VARCHAR2,
   property     NUMBER,
   value        NUMBER);

where item_name is the radio group name
button name is the radio button name
property will be LABEL
value will be the database field value;

regards
annamalai
0
 
LVL 6

Assisted Solution

by:musdu
musdu earned 80 total points
ID: 10848563
Hi,

"Another question is, if i retreive values from the data base how can i let the radio button or a combo box change it's state to the corresponding value."

just assign value to a radio group. It'll change it's state according to assigned value;

:MYBLOCK.MYRADIOGROUP := '1'; -- 1 should be one of the values of radio buttons in group

regards



0
 

Author Comment

by:Dj_maj
ID: 10849044

 Thanks for the help.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Via a live example, show how to take different types of Oracle backups using RMAN.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question