Solved

Menu Login

Posted on 2004-04-17
3
484 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 105 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 20 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

726 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