Database _User not connected! - message shown while loading _user.d using prodict\load_d.p

TKorban

New Member
Hello,
in the process of creating a new database, we usually load the tables definition and the sequences then load the users via administration UI.
i'm trying to make a systematic procedure to do this (a user interface executing OS commands in steps) and when calling the load_d procedure to load the _user.d file, I've encountered the mentioned message and the database remain with no authentication enabled domain. (no users are loaded).
I'll appreciate if anyone can help overcoming this issue.
Regards,
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
i'm trying to make a systematic procedure to do this (a user interface executing OS commands in steps)
Good!

when calling the load_d procedure to load the _user.d file, I've encountered the mentioned message
It would help if you shared your OE version number and the exact command lines you used.

the database remain with no authentication enabled domain. (no users are loaded).
Are you referring to the _sec-authentication-domain table? If not, can you explain what you mean?
 

TKorban

New Member
It would help if you shared your OE version number and the exact command lines you used.
Thx rob for the reply, the version is 11.7 SP 04

the code:

CONNECT VALUE(SUBST("&1&2", cDBPhysicalPath, cDBName)) -1 -ld VALUE(cDBName).
CREATE ALIAS DICTDB FOR DATABASE VALUE(cDBName).
RUN prodict/load_d.p("_User.d", cDumpDir).

Are you referring to the _sec-authentication-domain table? If not, can you explain what you mean?

i just mean that if next, i try to connect by providing a user name and password i got the error
1639747215842.png
means that the _user file was not loaded
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
In the title of this thread, you reference an error message that doesn't make sense to me. It suggests the runtime thinks "_User" is a logical database name. Can we see the exact error message?

the code:

CONNECT VALUE(SUBST("&1&2", cDBPhysicalPath, cDBName)) -1 -ld VALUE(cDBName).
CREATE ALIAS DICTDB FOR DATABASE VALUE(cDBName).
RUN prodict/load_d.p("_User.d", cDumpDir).
This isn't all of the code. We can't see how those variables are defined/initialized. Can we see all of the code?

If you comment out the run statement do you still get the error?
 

TKorban

New Member
If you comment out the run statement do you still get the error?
sure, the messages shows when calling the run.
This isn't all of the code. We can't see how those variables are defined/initialized. Can we see all of the code?
you are right, the code consist of the below, where the button b_df is enabled in a .W that is launched via an icon as per the below screenshots, the cDBName variable contains the database name and the cRoot variable contains the target directory (start in) of the launch icon where the database files exists cDlc of course contains the DLC path.

Full code:
ON CHOOSE OF b_df IN FRAME DEFAULT-FRAME /* DF */

DO:

DEFINE VARIABLE cDir AS CHARACTER NO-UNDO.

DEFINE VARIABLE l AS LOGICAL NO-UNDO.

DEFINE VARIABLE cFile AS CHARACTER EXTENT 3 NO-UNDO.

DEFINE VARIABLE cDFToLoad AS CHARACTER NO-UNDO.

DEFINE VARIABLE lUsers AS LOGICAL NO-UNDO.

DEFINE VARIABLE lSeq AS LOGICAL NO-UNDO.

DEFINE VARIABLE lCollation AS LOGICAL NO-UNDO.

DEFINE VARIABLE lSeqDef AS LOGICAL NO-UNDO.

DEFINE VARIABLE i AS INTEGER NO-UNDO.



SYSTEM-DIALOG GET-DIR cDir

TITLE "Select a directory where df file exists"

UPDATE l .

IF NOT l THEN RETURN NO-APPLY.



INPUT FROM OS-DIR(cDir).

REPEAT:

IMPORT cFile.

IF ENTRY(NUM-ENTRIES(cFile[1], "."), cFile[1], ".") = "df" THEN DO:

IF cFile[1] = "_tran.df" THEN DO:

lCollation = true.

NEXT.

END.

IF cFile[1] = "_seqdefs.df" THEN DO:

lSeqDef = true.

NEXT.

END.

cDFToLoad = cDFToLoad + "," + cFile[1].

END.

IF cFile[1] = "_USER.d" THEN lUsers = YES.

IF cFile[1] = "_SeqVal.d" THEN lSeq = YES.

END.

INPUT CLOSE.



cDFToLoad = TRIM(cDFToLoad, ",").

IF cDFToLoad = "" THEN DO:

MESSAGE "Selected directory does not contains structure file!!" SKIP

"Please validate and retry!"

VIEW-AS ALERT-BOX ERROR.

RETURN NO-APPLY.

END.



MESSAGE SUBST("Process will load the following to database &1", cDBName) SKIP

"" (IF lCollation THEN CHR(9) + "_tran.df" + CHR(10) ELSE "")

CHR(9) REPLACE(cDFToLoad, ",", CHR(10) + CHR(9)) SKIP

"" (IF lSeqDef THEN CHR(9) + "_seqdefs.df" + CHR(10) ELSE "")

"" (IF lUSers OR lSeq THEN "And The following data:" + CHR(10) ELSE "")

"" (IF lUsers THEN CHR(9) + "_User.d" + CHR(10) ELSE "")

"" (IF lSeq THEN CHR(9) + "_seqVal.d" + CHR(10) ELSE "") SKIP

"Are you sure you want to proceed?"

VIEW-AS ALERT-BOX QUESTION BUTTONS YES-NO UPDATE l.



IF NOT l THEN RETURN NO-APPLY.

MESSAGE "attempting to Connect to: " SUBST("&1&2", cRoot, cDBName)

VIEW-AS ALERT-BOX INFO.

CONNECT VALUE(SUBST("&1&2", cRoot, cDBName)) -1 -ld VALUE(cDBName).



IF NOT CONNECTED (cDBName) THEN DO:

MESSAGE "Sorry, connection failed!" SKIP

ERROR-STATUS:GET-MESSAGE(1)

VIEW-AS ALERT-BOX ERROR.

RETURN NO-APPLY.

END.

CREATE ALIAS DICTDB FOR DATABASE VALUE(cDBName).



IF lCollation THEN DO:

Message "Loading Collation table" "_tran.df".

RUN prodict/load_df.p(SUBST("&1\&2", cDir, "_tran.df")).



DISCONNECT VALUE(cDBName).

OS-COMMAND VALUE(SUBST("&1\bin\proutil &2 -C idxbuild All",

cDlc,

cDBName)).



CONNECT VALUE(SUBST("&1&2", cRoot, cDBName)) -1 -ld VALUE(cDBName).



IF NOT CONNECTED (cDBName) THEN DO:

MESSAGE "Sorry, connection failed!" SKIP

ERROR-STATUS:GET-MESSAGE(1)

VIEW-AS ALERT-BOX ERROR.

RETURN NO-APPLY.

END.



END.



DO i = 1 TO NUM-ENTRIES (cDFToLoad):

Message "Loading df file" ENTRY(i,cDFToLoad).

RUN prodict/load_df.p(SUBST("&1\&2", cDir, ENTRY(i,cDFToLoad))).

END.



IF lSeqDef THEN DO:

Message "Loading sequence definition" "_seqdefs.df".

RUN prodict/load_df.p(SUBST("&1\&2", cDir, "_seqdefs.df")).

END.







IF lSeq THEN DO:

Message "Loading _seqVal.d from under" cDir.

RUN prodict/load_d.p("_seqVal.d", cDir).

Message "_seqVal.d loaded".

END.



IF lUSers THEN DO:

Message "Loading _User.d from under" cDir.

RUN prodict/load_d.p("_User.d", cDir).

Message "_User.d loaded".

END.



DISCONNECT VALUE(cDBName).



OS-COMMAND VALUE(SUBST("&1\bin\probkup &2 .\&2_AfterStructure.dbk ",

cDlc,

cDBName)).



END.

Icon:
1639749517110.png

when ran, the following sequence of messages appears:
1639749797198.png
1639749819609.png
1639749871366.png
 

TomBascom

Curmudgeon
You may have other problems but:

Code:
RUN prodict/load_d.p("_User.d", cDir).

The 1st argument to load_d.p is the table name and the 2nd argument should be a file name, not a directory name.
 

TKorban

New Member
Thank you Mr Tom, the fix has solved the issue.. it was a silly mistake but the message did not help to discover it.
 
Top