This discussion is archived
7 Replies Latest reply: Mar 22, 2010 6:35 AM by InoL RSS

FRM-40734 Internal Error PL/SQL error occurred

user584056 Newbie
Currently Being Moderated
Hi All,

I set username,password and connect string in regedit path.

I am having only on-logon trigger in my form. In that I am having following code.

DECLARE
m_un          VARCHAR2(80) := Get_Application_Property(USERNAME);
m_pw          VARCHAR2(80) := Get_Application_Property(PASSWORD);
m_cs          VARCHAR2(80) := Get_Application_Property(CONNECT_STRING);
m_reg_pw     VARCHAR2(80) ;
M_DBUSER VARCHAR2(30);
BEGIN
M_DBUSER := RTRIM(LTRIM(m_un));
IF m_pw IS NULL THEN
     m_un := WIN_API_ENVIRONMENT.READ_REGISTRY('HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\UPC\ODB','OUD_'||M_DBUSER,TRUE);
     m_pw := WIN_API_ENVIRONMENT.READ_REGISTRY('HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\UPC\ODB','OPD_'||M_DBUSER,TRUE);
     m_cs := WIN_API_ENVIRONMENT.READ_REGISTRY('HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\UPC\ODB','OCN_'||M_DBUSER,TRUE);
          MESSAGE('m_un'||m_cs);
END IF;

IF m_cs IS NOT NULL THEN
     LOGON(m_un,m_pw||'@'||m_cs);
ELSE
     LOGON(m_un,m_pw);
END IF;

END;

Through this on-logon trigger I am giving username,password and connect string for runtime.

I connected to the database and compiled this form. And run this successully. But when I try run this form from compiled version I am getting the error as 'FRM-40734 Internal Error PL/SQL error occurred '. Because username,password everything is going as null.why its going like this?

Plz provide me the solution on this.

Regards,
Lakshmi.P.

Edited by: user584056 on Mar 15, 2010 3:10 AM
  • 1. Re: FRM-40734 Internal Error PL/SQL error occurred
    Zeeshan BaiG Oracle ACE
    Currently Being Moderated
    is your PLL and PLX Library file exists in Forms Path on runtime?

    I think problem is here WIN_API_ENVIRONMENT.READ_REGISTRY if your Variables coming Null

    Baig,
    http://baigsorcl.blogspot.com
  • 2. Re: FRM-40734 Internal Error PL/SQL error occurred
    user584056 Newbie
    Currently Being Moderated
    Yes,the variables are coming null for WIN_API_ENVIRONMENT.READ_REGISTRY.When I run this form locally, 'Get_Application_Property(USERNAME);' is working. But when run the form from compiled version, its not working. Then,how to modify this code?

    Can u plz provide me the solution?
  • 3. Re: FRM-40734 Internal Error PL/SQL error occurred
    InoL Guru
    Currently Being Moderated
    What is your Forms version? This code can only be used in a Forms 6i client/server environment. You cannot do this in a web environment because you would be reading the server's registry.

    If it is c/s, make sure the registry path exists on the PC where you run the form.


    What do you mean by compiled as opposed to running locally? Even running it locally the form will first compile.
  • 4. Re: FRM-40734 Internal Error PL/SQL error occurred
    user584056 Newbie
    Currently Being Moderated
    I have set regedit path for username,password and connect string. And I created d2kwutil_path and set the bin value.

    We compile and run the form only. Here,login has done automatically. But when we double click the executable to run it again, its showing me an error message as 'Frm-40734 Internal error pl/sql occurred'.

    What will be the problem in that?
  • 5. Re: FRM-40734 Internal Error PL/SQL error occurred
    InoL Guru
    Currently Being Moderated
    Again, what is your Forms version?

    And what do you mean by double clicking the executable? Forms doesn't have an executable, only a compiled fmx file. You can double click the fmx, but you have to make sure that the .fmx extension is linked to the correct executable to open it with (in this case Oracle Forms runtime).
  • 6. Re: FRM-40734 Internal Error PL/SQL error occurred
    user584056 Newbie
    Currently Being Moderated
    Actually what I am trying to do in my form is, each time user is giving username,password,connect string to access the application.We are trying to ignore this.We are sending fmx only to execute this process.

    So we set regedit
    @ REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\ /v PU_PL /t REG_SZ /d AAIC_QC_p9_AAIC_PWD_CUST /f

    @ REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\ /v PP_PL /t REG_SZ /d AAIC_QC_p9_AAIC_PWD_CUST /f

    @ REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\ /v PC_PL /t REG_SZ /d 0193 /f

    And I created D2KWUTIL60_path under oracle(in regedit) and set my bin path there.

    Then in on-logon trigger, I called login procedure. In that we are having coding as,
    PROCEDURE login IS
    m_un VARCHAR2(80) := Get_Application_Property(USERNAME);
    m_pw VARCHAR2(80) := Get_Application_Property(PASSWORD);
    m_cs VARCHAR2(80) := Get_Application_Property(CONNECT_STRING);
    m_reg_pw VARCHAR2(80) ;
    M_DBUSER VARCHAR2(30);
    M_DBPASSWORD VARCHAR2(30);
    M_DBCSTRING VARCHAR2(30);
    BEGIN
    M_DBUSER := RTRIM(LTRIM(m_un));
    M_DBPASSWORD := RTRIM(LTRIM(m_pw));
    M_DBCSTRING := RTRIM(LTRIM(m_cs));
    IF m_pw IS NULL THEN
    begin
    m_un := WIN_API_ENVIRONMENT.READ_REGISTRY('HKEY_LOCAL_MACHINE\SOFTWARE','PU_'||M_DBUSER,TRUE);
    m_pw := WIN_API_ENVIRONMENT.READ_REGISTRY('HKEY_LOCAL_MACHINE\SOFTWARE','PP_'||M_DBUSER,TRUE);
    m_cs := WIN_API_ENVIRONMENT.READ_REGISTRY('HKEY_LOCAL_MACHINE\SOFTWARE','PC_'||M_DBUSER,TRUE);
    EXCEPTION
    WHEN OTHERS THEN
    MESSAGE(sqlerrm(sqlcode));
    END;
    END IF;
    IF m_cs IS NOT NULL THEN
    LOGON(m_un,m_pw||'@'||m_cs);
    ELSE
    LOGON(m_un,m_pw);
    END IF;
    END;

    I run this form and I connected with db successfully,without giving username and password.I compiled this form and I created fmx and sent to my desktop.I right click this and set start in as my bin path and target as D:\Forms6i\BIN\ifrun60.EXE userid=PL module=LOGINSCREEN_LAKS.fmx.

    userid as AAIC_QC_p9_AAIC_PWD_CUST
    password as AAIC_QC_p9_AAIC_PWD_CUST
    connect string as 0193

    But when I double click this icon, the coding is going into exception.Loop is gone into 'if loop' and executed exception section.

    I think, I cleared u everything....

    Can u plz provide me the solution now....

    Regards,
    Lakshmi.P.
  • 7. Re: FRM-40734 Internal Error PL/SQL error occurred
    InoL Guru
    Currently Being Moderated
    When you run your form from Forms Builder, you are actually already logged in. The form you are running takes the username and password from Forms Builder. So, you are not running this code:
    IF m_pw IS NULL THEN
    begin
      m_un := WIN_API_ENVIRONMENT.READ_REGISTRY('HKEY_LOCAL_MACHINE\SOFTWARE','PU_'||M_DBUSER,TRUE);
      ...
    m_pw is never NULL when you run from Forms Builder. Try it by making m_pw NULL just before the IF. My guess is that you get the same error now when running from Forms Builder.

    If you run the fmx file, the Form will go into the IF branche. So, it just cannot run WIN_API_ENVIRONMENT.READ_REGISTRY for some reason. Maybe you don't have access to the registry key, or the key is wrong. I don't use d2kwutil, so I cannot look further into it.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points