Jump to content

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

Recommended Posts

Posted

Is there a script if step that can be used to determine if a database file is being opened on the machine the files reside (host), or if they are being opend via a client? And can this script NOT be based on the name of the computer, in case the files are installed on a different computer?

Larry

Posted

Use an IF conditional with the Status(CurrentMultiUserStatus) expression. It returns 0 for a single user file, 1 for a multiuser file on the host computer, or 2 for a multiuser file on a guest computer.

Posted

There are a couple of possibilities you could consider.

For example, the Status(CurrentMultiUserStatus) function returns 0 for a single user file, 1 for a multiuser file on the host computer, or 2 for a multiuser file on a guest computer.

The only instance where this might not produce the result you are looking for is if a local disk is serving files to a network and a db is opened over the network by another computer (never a good idea - can lead to file corruption if the network falls over - is likely to be slow, and is not an efficient use of resources...)

As an alternative (or perhaps an adjunct) you could use the Status(CurrentFilePath) function, which returns a file path in URL style format, meaning that the first five characters will be "file:" if the path is to a local volume/drive.

You could therefore use the test Left(Status(CurrentFilePath), 5) = "file:" which will return TRUE if the file is local and FALSE if it is on a remote volume, regardless of whether the current computer is the host.

I suspect the script test that you are looking for mught be something along the lines of:

If [" Status(CurrentMultiUserStatus) = 1 and Left(Status(CurrentFilePath), 5) = "file:" "]

(place your conditional script actions here)

EndIf

...which will only return a positive result if the file is on a local drive and is being hosted locally.

This topic is 8117 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.