This content has been marked as final. Show 7 replies
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.
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?
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).
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 := RTRIM(LTRIM(m_un));
M_DBPASSWORD := RTRIM(LTRIM(m_pw));
M_DBCSTRING := RTRIM(LTRIM(m_cs));
IF m_pw IS NULL THEN
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);
WHEN OTHERS THEN
IF m_cs IS NOT NULL THEN
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....
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:
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 m_pw IS NULL THEN begin m_un := WIN_API_ENVIRONMENT.READ_REGISTRY('HKEY_LOCAL_MACHINE\SOFTWARE','PU_'||M_DBUSER,TRUE); ...
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.