Help: Exit the FORM when user makes failed attempt to logon

Hi,
In this application, I added a on-logon trigger with a line:
logon(' ','@DB-CONN');
DB-CONN is the default database connection string.
What I really want to add is every failed logon attempt will be given and the 3rd failed attempt will kick the user out.
Right now, I have the problem that even user clicks CANCEL button, the form will be started without DB connection. Any suggestions will be greatly appreciated.
Thanks.
Jimmy

hi
Login button code.
when-button-pressed trigger.
if :LOGIN_BLOCK.USERNAME is null then
message('User must be entered !');
go_item('LOGIN_BLOCK.USERNAME');
return;
end if;
if :LOGIN_BLOCK.PASS_WORD is null then
MESSAGE('Password must be entered !');
go_item('LOGIN_BLOCK.PASS_WORD');
return;
end if;
set_application_property(CURSOR_STYLE,'normal');
:global.bad  := 0;
if :LOGIN_BLOCK.CONNECT_STRING is null then
logon(:LOGIN_BLOCK.USERNAME,:LOGIN_BLOCK.PASS_WORD, FALSE);
else
logon(:LOGIN_BLOCK.USERNAME,:LOGIN_BLOCK.PASS_WORD||'@'||:LOGIN_BLOCK.CONNECT_STRING, FALSE);
end if;
if :global.bad = 0 and form_success then
set_application_property(CURSOR_STYLE,'normal');
open_form('TREE',no_hide,no_replace);
exit_form;
ELSE
:global.v_attempt  := :global.v_attempt  + 3;
set_application_property(CURSOR_STYLE,'normal');
if :global.v_attempt  < 2 then
   MESSAGE('Username/Password was invalid. Please re-enter !');
   go_item('LOGIN_BLOCK.USERNAME');
else
   MESSAGE('Invalid Login Attempts.Please contact Admin');
   exit_form(no_validate);
end if;
end if;On-Logon trigger.(Form Level)
logon(get_application_property(USERNAME),
     get_application_property(PASSWORD)||'@'||get_application_property(CONNECT_STRING), FALSE);
if not form_success then
:global.bad := 1;
raise form_trigger_failure;
end if;create a Procedure.
PROCEDURE Log_on IS
BEGIN
:global.quit := 'TRUE';
exit_form(no_validate);
END;the following code for Pre-Form trigger(Form Level).
BEGIN
:global.quit := 'FALSE';
:global.v_attempt := 0;
END;I hope it will help u.
Sarah

Similar Messages

  • Exiting the form when a text item has focus

    I am a beginner, beginner using developer/2000.
    I made a form with some text items that are linked to the
    database.
    When one of the text items has focus and I click the push button
    that i created to exit the form, I get the message FIELD MUST BE
    ENTERED.
    I want to exit the form regardless of whether the cursor is
    currently in any text items.
    I hope this makes sense.
    Thanks, fred

    What you probably want to do as well is set mouse navigate to
    FALSE on the text field.
    Regards
    Grant Ronald
    Forms Product Management

  • Closing the Applet when I exit the form

    I am deploying an application on web plataform using Forms Server 6i. I have created my own base.html with a logo and a menu as appropiate. I am using Oracle JInitiator to run the forms. When I run a form, the applet is loaded in a frame created in my base.html. All is working fine, but, when I exit the form, I supposse the applet it's still there, because in the page a gray rectangle still remains. I would like to have a background image in the page, and when I close the form, the applet was unloaded, so I can view the background again. How can I get that.
    Thanks.
    P.D.: Sorry but my english it's not so good.

    Make a new project and import old one into this new one.
    See if you can find a up to date Auto Save.
    Also make a habit of 'Save A Copy' to a different drive after each edit session. Save A Copy does not overwrite after so many times as Auto Save does.

  • How to Unload the form when the user presses Escape Key

    Hi all
    I have tried several triggers for unloading the form when the user presses escape key,but none of them worked. Could any body give the trigger name and the code that unloads or closes the form when the user presses escape key.

    Hello,
    Change the EXIT entry of you ressource file:
    27   : 0 : "F4"             : 32 : "Exit"Francois

  • How to catch data from Purchase Order form, when user click CLOSE menu?

    Hi,
    I need do my own biz process when user click CLOSE in the Data menu to close a purchase order.
    But I don't know how to get data from PO form which opened by user.
    Can anybody give me some suggestions? thanks.

    Clicking "Close" is menuUID 1286. (Check this by going to View->System Information, and then hovering your mouse over "Close" in the menu. The menuUID is displayed in the bottom left of the screen)
    So catch the menu event, when menuUID and pVal.BeforeAction = True.
    The slightly tricky thing here is that pVal for a menu event doesn't give you the form, but it will be the active form, so you can do this:
    Private Sub SBO_Application_MenuEvent(pVal As SAPbouiCOM.IMenuEvent, BubbleEvent As Boolean)
         If(pVal.BeforeAction And pVal.menuUID = "1286")
             SAPbouiCOM.Form oForm = SBO_Applcation.Forms.ActiveForm
             //Now you have the form, when the user has clicked close, so process the data
             //from the form as normal
         End If
    End Sub
    Syntax might be wrong, I typed it up from memory and have no error checker!
    Edited by: njmog1 on Feb 28, 2011 10:35 AM

  • I use captivate 8, the problem when i make app for android. the sound not heard. i use android4.4. how i do?

    i use captivate 8, the problem when i make app for android. the sound not heard.
    i use android4.4. how i do?
    i use phonegap online.
    thank you

    Yes I do spend a lot of time in China but I have had problems in other countires as well.  I am in China right now.
    I have two Gmail accounts and one Cox account.  Cox is my intranet provider back home.  I have had problems with all three accounts. 
    I have tried several outgoing port settings.  993, 995 465, 587 are some that I can remember trying.
    Sometimes my accounts will go offline without me doing anything.  This is all a mystery to me.  I don't have any idea why I have trouble like this.  A few minutes ago I changed my Cox account outgoing port and took the account on line and I got my incoming email but when I tried to forward an email that I got it would not go out. 
    Any ideas you have would be helpful.

  • I have an agreement form created in word doc. i want to hire some one experience with formscentral to recreate the form and user be able to complete the agreement, sign it electronically (using echosign) then click submit. i will be alert of new response.

    i have an agreement form created in word doc. i want to hire some one experience with formscentral to recreate the form and user be able to complete the agreement, sign it electronically (using echosign) then click submit. i will be alert of new response. can someone connect me to where i can talk to someone can provide this service. i have sample of agreement form

    Hi c3 cyber club,
    Unfortunately FormCentral and Echosign are two different services and forms created in Forms central can only be submitted via and to Forms Central.
    We cannot have the form filled in using FormCentral and get it signed using Echosign.
    However, you can use Echosign directly and you can get most of the functionality.
    Thanks,
    Vikrantt Singh

  • How can i do this in Captivate 7 "The idea when user click on "Correct answer" button, drag source m

    How can i do this in Captivate 7 "The idea when user click on "Correct answer" button, drag source move to drop target automatically".

    I suppose you are talking about the D&D interaction? Could you explain more? What is your level of expertise with advanced actions and Effects?

  • ICal does not allow me to edit "minutes" in the appointments. when i make an appointment it defaults it to xxhrs 08mins (example 16:08) how can i make an appointment for 16:00 or 15:30 hrs ...etc.

    iCal does not allow me to edit "minutes" in the appointments. when i make an appointment it defaults it to xxhrs 08mins (example 16:08) how can i make an appointment for 16:00 or 15:30 hrs ...etc.

    Hi,
    You can change this in System Preferences, Language & Text.
    Go to System Preferences > Language & Text > Formats tab and change where it says Custom to your location. Then re-open iCal.
    Let us know how it goes.
    Best wishes
    John M

  • How to replace message in the forms when table level constraint fails!!

    Hello all,
    I have table level constraint in database.
    when constraint fails i get message in the forms like
    "ORA-00001 : UInique Constraint (CYAN.FA_JV_DTL_PK) violated"
    I know i can replace this message by using trigger on-error.
    but for this I have to write on-error trigger in my all the forms.
    is there any short cut at database level?
    so i can map my messages for each and every constraint.
    by doing that database should send user defined message to the form instead of in-built database messages.
    From
    Chirag Patel
    Nairobi

    Chirag,
    I think this is english. I couldnt understand what exactly you want. Can you explain by not using short words and right spellings. I might help you.
    Thanks
    Ghulam

  • How do I return to the top of a form when input validation fails?

    I have a form that I am using spry input validation that I
    would like the user to be returned to the top of the page when
    validation fails. If that can't be done somewhat easily, can I have
    a message appear next to the submit button that says "Errors found.
    The field(s) marked in red need to be corrected" when there are any
    errors that prevent the form from submitting.

    The break statement in Java is similar to last in Perl.
    The continue statement in Java is similar to next in Perl.

  • Exit the program ,when the condiiton fails

    Hi Experts,
    I want to leave leave the program it self ,
    if the condition fails indise the nested if statement.
    I have tried using exit statement in nested if condition, but it is exiting the current loop.
    Thanks in Advance
    Regards,
    Irfan

    Hi,
    My problem is like this
    if cntry eq 'us'
    if condition 1.
    sy-subrc eq 0.
    proceed.else terminate the program.
    if condition 2.
    sy-subrc eq 0
    success
    else
    leave the program.
    elseif cntry eq 'de'
    same as  above.
    else.
    if cntry ne 'de'.
    same as above.
    endif.
    Please help me out.
    Thanks in Advance
    Irfan Hussain

  • Design help to the forms

    Hi gayes
    I need your help in designing help to any any working screen such that when the user push F1 buttons , click the right buttons of the mouse and choose help from the popmenu,or choose help from the menu bar . It must give him the correct help.
    Also this "help screen" how could I make it,and connect it to the help of windows98 to work.
    Thanks

    Hi Kimberg Howe,
    You have several alternatives to generate a .hlp file. You can do it manually in words and save the file as a rich-text-format (.rtf), and then use the Microsoft Help Workshop (a Free Program obtainable from www.microsoft.com site) but realize that you will have to code all the Winhelp engine commands and that's some task. However, you can investin some WYSWYG winhelp file generators. I guess it is not appropriate to suggest any in this forum, but you can do a search on any search engine for keyword "Winhelp", or you can also search on www.download.com
    What this program will do for you is to allow you design your help file and then generate the .hlp for you, some of these programs can also allow you to generate html files that is suitable for web forms.
    I hope this help.

  • Dynamically adding fields to the form when button pressed

    Hi all,
    In my application, there is a form from which I need to be able to insert data into 7 to 8 tables...
    Creating a view and inserting data into 5 table sis fine but there are 2 table whose structure is as follows.
    server_app_rel : server_id, app_id
    server_jack_rel : server_id, jack_id
    Here each server can have any number of applications and any number of jacks...
    I am not able to create a view ( to create a form on this view).. since the number of appllication and jack columns are not fixed. The user should be able to associate all the applications and jacks to the server in the same form...How can I insert multiple rows into tables from a single form when I dont know how many application and jacks(app/jack columns) the user will associate to the server..
    Also, How can we add fields dynamically to the form?
    Our requirement is by default we have to show only one application field and one jack field in the form..And when the user clicks on 'Add more Jacks' or 'Add more Apps' button, respective fields should appear on the form to add data..( this is like 'Add column' button when we create table)..
    Can someone please give me inputs on how to proceed..Am stuck with this from 2 days..It would be really very helpful if someone can give me atleast the links where i can find this info..
    Thanks,
    Nehal

    Here is what I mean
    http://www.drinknation.com/barbook.php?op=multi

  • How to execute the data in the form when the data is already avaliable

    Hi,
    I am working with forms 6i. I have a problem while executing the data in the form
    Actually, the data is already present in the form. But when i run the form, the data is not displayed.
    can anyone please help me how to execute the data. below is the code
    Set_Alert_Property(alert_id,ALERT_MESSAGE_TEXT,'Do you want to refresh new Data for that Year and Field ? (it will take a time).') ;
                   SET_ALERT_BUTTON_PROPERTY(alert_id, ALERT_BUTTON1, LABEL, 'Yes');
                   SET_ALERT_BUTTON_PROPERTY(alert_id, ALERT_BUTTON2, LABEL, 'No');
                   SET_ALERT_BUTTON_PROPERTY(alert_id, ALERT_BUTTON3, LABEL, 'Cancel');
                   button_number :=Show_Alert(alert_id) ;
                   synchronize;
                   if button_number != ALERT_BUTTON3 then
                        if button_number = ALERT_BUTTON1 then
                             :param.field := :control.f_cd;
                             :param.year := :control.year;
                             build_tables;
                             fields;
    -- areas(:param.field);
                             PUT_PARAM;
                             COMMIT_FORM;
                        go_block('wet_criterias');
                        end if;
                        if button_number = ALERT_BUTTON2 then
                             :exhibits.field_display := :control.f_name || ' - Exhibits';
                             go_block('RESERVOIR');
                             execute_query;
                        end if;
                   end if;
              end if;
    else
         message('Fields must be entered...');
    end if;
    else
    message('Fields must be entered...');
    end if;

    It's hard to know what logic you are trying to implement.
    However, by looking at your code, it seems that if the user select 'Yes' to the question "Do you want to refresh", nothing is done except the go_block('wet_criterias'). Should there be an 'Execute_Query' ?
    No idea...

Maybe you are looking for

  • Functinality to compare two material price with reference to BOM in CO

    Hi All, Is there is any functionality in Controlling which can compare the costing for two FERT materials. or is there is  any functionality where we can compare two material price with reference to BOM in controlling Please help me to compare the ma

  • Selecting and copying a JLabels contents

    I dynamically update the label contents depending on the hardware attached to the system. I want the user to be able to use the mouse and select the text so that they can copy and paste as needed. JLabel by default don't allow Input events and thus m

  • Adapter PI7.1 Module Problem

    hi, i'm facing a weird problem , i'll explain: I developed a module adapter to be able get the dynamic file name into a zip file because i'm using the AF_Modules/PayloadZipBean and as we know the name of the file inside  the zip in a standar way is s

  • Using images in Spry menus

    Can someone please point me to instructions on how to incorporate button images in horizontal Spry menus?

  • How to construct the HashMap

    Hey there, Im new to hashmaps (I always felt fine using Arrays for the simple scripts i made thusfar). Now I have a list that lookst like this: Word > synomym1, synonym 2 Word2 > synomym1, synonym 2 etc... How do I construct the Hashmap for this purp