Help with Error (W 10102) - "...index could not be created..."

Discussions about creating CAPI applications to run on Android devices
Forum rules
New release: CSPro 8.0
Post Reply
Marc
Posts: 8
Joined: February 20th, 2018, 3:02 am

Help with Error (W 10102) - "...index could not be created..."

Post by Marc »

Hi all,

I am reaching out for a little help with regard to this particular error message. I've tried for a while now to beat it but I'm at a point I'll take some expert advice on it.

Exact error message:
Entry Message (W 10102)
"Could not open the data source CBHS_MENU_SURVEYKEY_01_DICT: An index could not be created for a data file with duplicate case IDs, including: 'Label=CBHS_Menu_'
A little context on my application.

I have a 3 applications, 2 of which act as menus, and the third is actual questionnaire.

CBHS_Sandbox_Menu_01 - Main menu program, static PFF
CBHS_Sandbox_Substitution_01 - 2nd menu program, dynamically created PFF (has cases for notes) - acts as a kind of Cover page for survey capturing things such as: Is household available? Is substitution required, trip # and notes for respective # etc. If all is greenlight on beginning survey, it launches the below Questionnaire file.
CBHS_Sandbox_01 - Questionnaire, dynamically created PFF (has cases)



I also have 2 external dictionaries
CBHS_Menu_Surveykey_01.dcf - input is .txt file with list of available households for processing and other status type variables. This file is looped over to create dynamic valueset. It is also read/updated in all three applications. (IE- Completion_Status)

CBHS_Substition_Key_Deck.dcf - similar to above, but holds list of possible substitutions available to be selected. .txt file is read/updated when a substitution is selected from the list (IE- Valid_Status).

I receive the above error when the below process is taken:
Main Menu: Launch Main Menu, select household to interview, select begin. (System creates .pff for next execpff and execs SUBSTITUTION_01)
Substitution: Question is answered that household is available to begin interview. (System creates .pff for next execpff and execs SANDBOX_01)
***Error Message occurs here***
Result of error is that .dcf input file is set to blank because could not open actual data source.

I felt like this was a fault on the way I've coded the programs, and was occurring due to a missed CLOSE() statement on my part, but i've overly coded CLOSE() statements in an attempt to resolve the error and this was unable to resolve the issue.

Are there any insights as to why this is occurring and how I can address this issue?
Is this indeed an issue where the system is attempting to open a file under lock by previous apps(menus)?

I appreciate the guidance as always.

Thank you,
Marc
Marc
Posts: 8
Joined: February 20th, 2018, 3:02 am

Re: Help with Error (W 10102) - "...index could not be created..."

Post by Marc »

In my program, the External Files statement of my .pff generating logic had the .dcf as the file, instead of the .txt. When I change the code from this:
filewrite(pffFile,"[ExternalFiles]");
filewrite(pffFile,"CBHS_MENU_SURVEYKEY_01_DICT=" + pathname(Application) + "/CBHS_Menu_Surveykey_01.dcf");
to this
filewrite(pffFile,"[ExternalFiles]");
filewrite(pffFile,"CBHS_MENU_SURVEYKEY_01_DICT=" + pathname(Application) + "/CBHS_Menu_Surveykey_01.txt");
The error went away.

My follow-up question is, should the .txt (input file) be linked in External Files or the Dictionary itself? (.dcf)
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Help with Error (W 10102) - "...index could not be created..."

Post by josh »

The external files section in the pff is what links the dictionary to the data file (text file in your case). The line

Code: Select all

CBHS_MENU_SURVEYKEY_01_DICT=CBHS_Menu_Surveykey_01.txt
makes an association between the dictionary named CBHS_MENU_SURVEYKEY_01_DICT and the data file CBHS_Menu_Surveykey_01.txt. When CSPro launches the application it looks through the list of dictionaries in the application and finds the one that is named CBHS_MENU_SURVEYKEY_01_DICT (not the filename but the name specified in the dictionary editor). It then opens the data file CBHS_Menu_Surveykey_01.txt, builds the index and links it to the dictionary.
Post Reply