The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

This topic is READ ONLY
import-bot (20211) [Avatar] Offline
[Originally posted by ksmenon]

Hi All.

I have just started on PFC and am currently trying to get the Security and
Admin module to work. I will briefly explain what the problem is:

1. I have inherited n_cst_myappmanager from n_cst_appmanager
2. I have set of_security(TRUE) in the constructor of n_cst_myappmanager
3. I have set SQLCA to be of type n_tr
4. I have global variable gnv_app of type n_cst_myappmanager
5. The pfc_open event of n_cst_myappmanager opens a window w_my_frame
inherited from w_frame
6. The open event of w_my_frame calls gnv_app.of_LogonDlg which pops up a
login screen and connects to the database.
ls_inifile = gnv_App.of_GetUserIniFile()
IF SQLCA.of_Init(ls_inifile, "Database") = -1 THEN
MessageBox("Database", "Could not initialise database")
Return -1
SQLCA.of_setUser(as_userid, as_password)
IF SQLCA.of_connect() = -1 THEN
Return -1
IF isValid(gnv_app.inv_security) THEN
gnv_app.inv_security.of_initsecurity(SQLCA, iapp_object.appname,
of_getUSerID(), "Default")
Return 1

Then it sets security for w_my_frame using the following syntax

7. When I run the application, I succesfully manage to log on. However,
security is never set because gnv_app.inv_security.of_setsecurity(this)
returns a boolean false. On debugging, I found the following condition
If Not ib_initsecurity Then Return False
was occurring for the function of_security for pfc_n_cst_security

Whew! Now my question is, what is ib_initsecurity ? Why is it false when I
have done a gnv_app.inv_security.of_initsecurity (succesfully - I checked the
return value) ?

What can I do? Please help.