Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a custom log on form 1

Status
Not open for further replies.

jeb33red

Programmer
Nov 7, 2005
1
0
0
GB
Hi,

I working with forms 6 Windows edition. I am trying to create a custom log on form - as I have 10 environments that a user can log onto - so a drop down list seemed a good idea.

I have used a ON-LOGON trigger and placed NULL in the code - this stops the standard oracle log on appearing.

I then created my logon form and added the code:

LOGON(connect_id,p_word||'@'|connect_str); - obviously these are varchar 2 variables that take text box field values.

Unfortunately - I get the 'FRM-40514 Operation requires a db connection' error.

I think it is something to do with the On_LOGON trigger - because - if I code an implicit logon into this - and then code the LOGOUT command before my LOGON code - everything is fine.

Unfortunately - this implicit LOGON - will fail the application - if ever the database password/user changes - has anyone got a better way? I think I am missing a command to tell forms that it must use an Oracle database?

Any ideas - would be great. Thank you for reading!
 
LOGON will only connect to the database when used within the ON-LOGON trigger. When used outside the trigger, it only has the effect of triggering ON-LOGON.

In your ON-LOGON you should use code similar to:

Code:
BEGIN
  IF  :block.connect_id IS NOT NULL
  THEN
    Logon(:block.connect_id,:block.p_word||'@'||:block.connect_str);
  ELSE
    NULL;
  END IF;
END;

Then you would simply trigger this from a button (perhaps) on your form like this:

Code:
BEGIN
  Logon(NULL,NULL);
END;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top