Using Windows Mapped Drives with FairCom DB
Windows mapped drives have specific access properties with respect to Windows Services such as FairCom DB
You might find that local drive mounts don't always work under FairCom DB. For example, consider that you have a Windows drive share called fcdata. You then map a drive to that shared folder:
> net use D: \\mymachine\fcdata
You create or access a FairCom DB file on that mapped drive such as D:\customer.dat, and you might find System error 3, folder not found, can be returned.
The problem is when FairCom DB is run as a Windows service which, by default, runs under the "LocalSystem" account which is has restricted access to potential external network mounts. To resolve this, you must ensure the service is running under an account that has permission to access that network share (e.g., a Domain User account), rather than the default "LocalSystem."
Ideally, you should use Windows UNC paths which are accepted. However, if your service absolutely requires a drive letter (e.g., it's an old legacy app that can't handle UNC paths), you have to tell the service to map the drive itself upon startup.
You can do this by running a net use command via a batch script or within your code before the service starts its main task:
net use Z: \\ServerName\ShareName /user:Domain\Username Password /persistent:yes
Warning: This is generally discouraged because it stores credentials in plain text or scripts, and mapped drives in services are notoriously unstable if the network becomes unavailable. Should a write to a transaction controlled file fail from such a situation, the FairCom DB service will shut down.