November 11, 200223 yr 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
November 11, 200223 yr 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.
November 11, 200223 yr 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.
Create an account or sign in to comment