This is not necessarily a shared database issue, but may relate to the issue of the timing and completion of an opensecret statement and the successful execution of the following statements. My understanding is that the opensecret statement does not change the active database. But I found a caveat to this principle.
This code when first executed after a database is opened, fails to initialize and the display the variables in the calling database.
opensecret "Timekeepers" letfileglobal fgstart=week1st(today()) letfileglobal fgend=fgstart+7 ....[More variables defined] openform "Admin Weekly" showvariables fgstart,fgend,fgtimeunit,fgdelta
The variables were in fact defined in Timekeepers, not in the calling database, which is what I had expected. If I close the Admin Weekly form and return to the calling form, and repeat the procedure (when Timekeepers is already open), it works correctly.
I found two ways to solve the problem: (1) I can put the opensecret statement at the end after showvariables; and (2) I can add a setactivedatabase [calling database name] statement after opensecret. Either one of these results in the variables being defined in the calling database and the form opens and displays correctly.
I wonder if it is possible for you to ensure that certain statements, like opensecret, are fully completed before the next step in the procedure is executed. I know that I normally think that is what will happen, but in the above case it is not correct.