misterimran
Programmer
Hi Friends,
I have made a form based on a control block. Block contains two non database items.
TXT_USER and TXT_PASSWORD. I have placed a button on this form with name LOGIN_BTN.
Now I want my user to connect to the databases they want to. For example it user Type SCOTT in TXT_USER field and TIGER in TXT_PASSWORD then he must logon to Scott/tiger user and can access the tables and view.
I am writing this code in my WHEN-BUTTON-PRESS event of the button.
IF :Login_Blk.Txt_User IS NOT NULL AND
:Login_Blk.Txt_Password IS NOT NULL THEN
LOGONLogin_Blk.Txt_User,:Login_Blk.Txt_Password||'@'||'ORCL_DEVP');
Call_Form('EMP.FMX');
END IF;
in my LOGON trigger of the form where i am taling User Name and Password from the user- I have written NULL.
ON-LOGON trigger
NULL;
When EMP form is called and I try to execute the query EMP forms gives an error.
FRM-40514 Operation requires a database connection.
I also want to handle the exception is user enters wrong User and Password. Then how can I generate message of wrong user or password? Is there any exception to write in the exception par of the block?
Please solve my problem.
Best regards,
Mirza Imran Baig
I have made a form based on a control block. Block contains two non database items.
TXT_USER and TXT_PASSWORD. I have placed a button on this form with name LOGIN_BTN.
Now I want my user to connect to the databases they want to. For example it user Type SCOTT in TXT_USER field and TIGER in TXT_PASSWORD then he must logon to Scott/tiger user and can access the tables and view.
I am writing this code in my WHEN-BUTTON-PRESS event of the button.
IF :Login_Blk.Txt_User IS NOT NULL AND
:Login_Blk.Txt_Password IS NOT NULL THEN
LOGONLogin_Blk.Txt_User,:Login_Blk.Txt_Password||'@'||'ORCL_DEVP');
Call_Form('EMP.FMX');
END IF;
in my LOGON trigger of the form where i am taling User Name and Password from the user- I have written NULL.
ON-LOGON trigger
NULL;
When EMP form is called and I try to execute the query EMP forms gives an error.
FRM-40514 Operation requires a database connection.
I also want to handle the exception is user enters wrong User and Password. Then how can I generate message of wrong user or password? Is there any exception to write in the exception par of the block?
Please solve my problem.
Best regards,
Mirza Imran Baig