Specify path to file with UNC

rpadams

Registered User.
Local time
Yesterday, 19:25
Joined
Jun 17, 2001
Messages
111
I went to the Microsoft knowledge base (304408) and found a routine that automatically logs off users with a short warning. It works fine, but depends on the presence or absence of a small text file which is named chkfile.ozx. The file is referenced in a form timer function as follows:

Dim StrFilename as String
strfilename = Dir("c:\MyDirectory\chkfile.ozx")

The function then tests for its presence and does its thing. You trigger the logoff by going in as sysop and changing the name of the file so it is no longer found.

The problem I have is that on the network, I use the backend file on the network and different users map different letters to it. I get around this by linking using UNC eg. \\ServerName\SYS\Data_be.mdb.

I put the chkfile.ozx into this directory since all users presumably have access to it.

I tried changing the trigger function to

strfilename = Dir("\\ServerName\SYS\chkfile.ozx")

but the program doesn't recognize the presence of the file. When I map it as "F:\SYS\chkfile.ozx" it works, but since all users will not be mapped to "F", it really isn't a solution.

Does anyone know the proper syntax to include in the Dir method for UNC naming?
 
Map the drive yourself first with your macro using RunApp. Just put the following in the command line - net use F: \\ServerName\SYS\ /user:someone password /persistent:no

If it is already mapped, it does nothing.

Chris B
 
I really don't understand what you are saying. My users are logged into a Novell network. Security is in the permissions they are given at that login. The program is used in a school district and only teachers and administrators have access to the directory where the program (both fe & be and the little textile) are kept. This directory is mapped to different letters depending on the building they are in. There is no place for them to put in an Access password; I'm not using Access security groups.
 
Password is optional - just showing where it would go if required. This is not an access password, rather one which might be required to permit the drive to be mapped. You said users would map random drive letters, that's fine, but this would map the location of your check file so Access could find it reliably.

net use F: \\ServerName\SYS\ /persistent:no

The /persistent:no just means it won't remember the mapping after reboot. This too is optional.

Chris B
 

Users who are viewing this thread

Back
Top Bottom