Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7033 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am having a problem closing files, I know it sounds ridiculous, and I'm sure I'm doing something stupid but here goes...

I have 4 databases and they need a high level of security for multiple users on multiple terminals, so I have included a lock script which closes all open windows and goes to the 'master' db and re-logins under a limiting password, which then makes the next user open again with their correct password. This works fine, but... one of the databases is still available via 'show window' under the window menu. Even if I try and close or hide the database without using a script it still is available with incorrect access rights.

This doesn't happen will all the databases, just one. This database has no relationships with the 'master' database.

I have been scratching my head for last couple of days, so any suggestions are welcome.

Thanks,

Kieron

Posted

Using the DatabaseNames design function, you can see which files are open. Maybe from this you can have your script close any open files. This may not work if these files have closing scripts that change fields (the closed files may open again.)

If that doesn't work, you could have a Relogin sub-script in each file that uses script parameters for the account and password. Then have the main file call each Relogin script for any open files. This would require you to use a custom dialog and collect the account and password in globals temporarily, instead of using the build-in login dialog. This would probably be more complicated than your current system; getting that custom dialog debugged is a lot of work.

Posted

Thanks for your comments. I was using the windownames function. I found the problem, it involved some kind of link bertween the 2 databases i.e. the 'master' and the 'problem' database. In filemaker help it told me that if you close a file that has links to another open file it will stay open. I couldn't find any links between the two files, but they both perform scripts in the other databases, so I am still unsure of the answer. In the end I have set up this very simple script called relogin 1 on all databases involved.

Set Error capture (On)

Re-login (account Name: Get (accountname))

If (get(lasterror)=1)

Show custom dialog("Error":"do you wish to re-login or quit Filemaker pro?"

If (get(lastmessagechoice)=1)

perform script(relogin 1)

else

exit application

End if

End if

This stops anyone cancelling the script and continuing on the wrong access privileges.

Thanks for your help.

Kieron

  • 4 months later...
Posted

Been trying everything I could think of to close a file so I can re-open it with a Opener file that enables the right access privileges.

It is indeed a problem that the file will stay open when another file has a a link to it. I use the close file or window script and the file will just stay in the 'Show Window' menu bar like: (filename).

Everything works well when my database is closed and u double click the file to open it. This will launch my Run Time.

But if the database is already opened and I open the file, I have to abort the opening of the file. Otherwise it will either Re-open the database (Quiting my Run Time) or I get a Circulating loop because the file opens with the wrong priviledge set.

It is a pitty that I can't close the file and Re-open it, using another file, so the user would be able to open the file he clicks on from his desktop.

Any comments are welcome...

This topic is 7033 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.