Question

Change User at Logon When Calling Form from Custome Login Form, Read Registry From PL-SQL

Asked by: Mateen

Hi Gurus,

MY Environment is
1) Backend Oracle 10g Release 2
2) Oracle Forms 6i with Patch 18
Here is an intresting thing which I have encounter may be it's an approach issue but thats how we have to do the job.

Senarios 1:
I have a custom login form which calls a main_menu form and then from there individual options runs.

Considerations:

1) User logins once
2) We set global variables at login
3) We login at login forms on-logon trigger a default user
now we wana change the things work earlier, now we have multiple users and a drop down combo
where user select where to login depending on that selection we wana re-login with different oracle DB user.

CASE:
It doesn't change the user.

Senario 2:

I wana read registry from PL/SQL and I found a way to do it but it doesnt work.

It compiles fine but at runtime it give an error FRM-40734.

I have check that the library D2KWUTIL is attached and there is not issue regarding this.

Please help its an urgent nature issue  and management is looking towards this solution.

So test your knowledge here as I am.

Please Help your most urgent reply is desireable.

Advance Thanks and regards,
Zee

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2007-07-13 at 09:57:17ID22695032
Tags

oracle

,

forms

,

change

,

login

,

user

Topics

Oracle 10.x

,

Databases Miscellaneous

,

Oracle Database

Participating Experts
2
Points
500
Comments
7

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Natural language queries
    Looking for a natural language queries solution for Oracle Enterprise edition.
  2. Implement Paging Mechanish with Oracle as backend
    Hi frenz!! I have Oracle 9i as the backend. My front screen has paging mechanism similar to Google. The total number of records will be displayed say 1000 No of records per page will be 50 so now there will 20 pages that User can movew through using "Prev First Last Ne...
  3. Logon user information using PL/SQL
    Hi, I am trying to develop an application which should capture the Windows logon user details. I am developing the application using Pl/SQL. I have tried using dbms_standard.loginuser. This gives me the username of Oracle database rather than Windows login details. Can anyon...
  4. Shifting backend database from Access to Oracle...
    Hi all, I have developed an application in VB6 with MS Access 2003 database and Crystal Reports (10). Now according to the new requirements of the client we have to shift the backend database from Access to Oracle. It is almost done successfully except the Crystal Repo...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: markgeerPosted on 2007-07-13 at 11:20:25ID: 19483222

I hope you are aware that Forms6i is considered obsolete and is no longer supported by Oracle.  (Yes, we run it too yet, but we hope to upgrade to Forms10 in the next couple of months).

The combination of Forms6i and Oracle10gR2 is problematic.  We use Forms6i with 10gR1, and that works well.

The D2KWUTIL library in Forms6i can be used to read the Windows registry (we do) at least with WindowsXP or earlier.  Windows Vista though is another matter - that may or may not work.  In our preliminary tests it did not work, but we are planning to do more tests of that combination yet.

It is possible in Forms6i to change the login, we do that in our custom application.

 

by: anand_2000vPosted on 2007-07-14 at 00:44:28ID: 19486142

use the on logon trigger along with the function logon

 

by: MateenPosted on 2007-07-14 at 08:01:51ID: 19487102

My friend I know that Oracle 10gR2 and 6i is a problem but my management is insisting to take this bully.

That's why I said there may be an issue of approach but we have to do it this way.

Secondly, I have tried On-Logon with logon function it doesnt change user from a MDI form to SDI form it remains the same as first passed user at on-logon trigger and even though you re-use logon function on called form on on-logon trigger it never change it.

And again it's an issue of approach that my management create user every year with a post-fix YY and reluctant to  use partition clause to avoid performance issue. It may be ignorance of lack of knowledge but thats the way it is (By the way I recently joined the comapny)

Anyways we need solution if any of the masters or guru could provide it.

And by now you must have understood that why we wana change user at logon form because user may wana go to Year 2006-2007 or 2007-2008 and so on and there are different physical DB users and management dont wana change the approach.

We can use HOST cammand and pass USERID/PASS but it that case environment global variable values gets lost which we cant afford since it is security / right concern variables.

Regards,
Zee.

 

by: markgeerPosted on 2007-07-14 at 20:54:58ID: 19489058

We use the logon built-in in Oracle Forms6i to swithch the user, both in the on-login trigger as well as optionally via a key trigger.  Having to use a differnt logon though just to see data for a different year looks like a an application and/or database design problems.  It shouldn't be neceassry to use a different logon to see data for a different year.

You indicated that management is reluctant to use partitions, but they can be very helpful for performance and data management.  It sounds like your management doesn't want to use Oracle the way it works best.  It seems like they want Oracle to work the way they think is best.  They didn't write Oracle though.

 

by: MateenPosted on 2007-07-15 at 18:42:01ID: 19492674

My Friend Again,

This is an issue with us. My management is a very old school. And u'll be surprise that we don't even have primary keys and foreign keys in our system which is not even a school old or new is out of question, so u can imagine.

Anyways, if u r saying that we can use LOGON built-in to switch the user when calling a form from custom logon form to mainmenu form so we have tried it is not working. And this was my first that it should work but it isn't.

Here is the code:

Declare
      the_connect varchar2(100);
Begin
      the_connect  := Get_Application_Property(CONNECT_STRING);
      if the_connect  is not null then
      logon('tbs','XXX@'||the_connect);  
      ELSE
         LOGON('tbs','XXX@ecltest');    
      END IF;
END;

We have tried the hard coded version on connect string as well just to check even thoug it doesn't make any difference since it is only geting the service name and username and password is hardcoded in this code.

Thanks and Regards,
Zee

 

by: markgeerPosted on 2007-07-16 at 05:40:46ID: 19494815

Here is part of a program unit that we use in the ON-LOGON trigger of the startup form for our application.  We also call this same program unit from a key trigger that the operators can use at any time to switch between our test system and our production system.  This key trigger works from the menu that is attached to all of our 6i forms, but we haven't tested this much with 10gR2.   We noticed significant record-locking problems with that combination, so we won't use 10gR2 until we upgrade our application to Froms10.

--      Check username first:
        LOGON('scott', 'tiger@' || common_pkg.db_name, FALSE);
        user_ok := user_pkg.ck_user(common_pkg.user_nm);
--            message('User_ok: "'||user_ok||'"');
        if user_ok in ('X','Y') then
              if user_ok = 'Y' then
                logout;
--                     message('Trying logon with a database password');
            db_secur := 'Y';
            -- Attempt a logon with a database password:
            LOGON(common_pkg.user_nm,common_pkg.appl_pw||'@'||common_pkg.db_name,TRUE);
          else
            user_pkg.pwd_valid(common_pkg.user_nm,common_pkg.appl_pw,pw_valid, msg_text);
            logout;
--          Check if password is expired, and do not fail here if that is true:            
            if pw_valid = 'N' then
                  if msg_text = 'Your password has expired. Please change it.' then
                        pw_valid := 'Y';
                  end if;
            end if;
            if pw_valid = 'Y' then
              -- Attempt a logon with the "application standard" password:
              LOGON(common_pkg.user_nm,db_pw||'@'||common_pkg.db_name,TRUE);
            else
                  display_alert('Logon Error',msg_text);
            end if;
          end if;
          IF FORM_FAILURE or pw_valid = 'N' THEN
          -- see if logon works with a valid username
            LOGON('scott', 'tiger@' || common_pkg.db_name, FALSE);
            IF FORM_FAILURE THEN
            -- no one is able to connect to oracle
              display_alert('Logon Error',
              'Error connecting to Oracle. Please call the Help Desk at x382.');
            else
              -- don't stay connected as this user (SCOTT/TIGER)
              logout;
            END IF;
            -- this user must be invalid
            if nvl(pw_valid,'Y') = 'Y' then
              display_alert('Invalid User/Password',
              'Invalid username or password provided.  Please try again.');
            end if;
          ELSE -- logon with returned values succeeded;
            if db_secur = 'Y' then
              pw_valid := 'Y';
            end if;
            if pw_valid = 'Y' then
              exit;
            else
                  logout;

 

by: MateenPosted on 2007-07-20 at 03:12:52ID: 19529809

Hi Friends,
This what I used and it worked as my last comment it was the issue of the behavior of LOGON Built-in
it calls ON-Logon Trigger when called and the code on that trigger was hard coded thats why it was always changing the user to default.

Here what I rewrite and we just change the GLOBAL variable values.

BEGIN
   DEFAULT_VALUE('N','global.logon_now');
   DEFAULT_VALUE('N','global.un');
   DEFAULT_VALUE('N','global.pw');
   DEFAULT_VALUE('N','global.cs');
   IF :global.logon_now = 'Y' THEN
      LOGON(:global.un, :global.pw||'@'||:global.cs);
   END IF;
END;

Sorry I coulgn't come back for couple of days.

Regards,
Zee

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...