Database development and training for Birmingham and the midlands
Specialists in Microsoft Access and Visual Foxpro database training and development
I am happy to hear from existing clients but I am taking no new calls.
FoxPro JustDrive function
The VFP JustDrive() function returns the drive letter from a string containing the full path of a file or a directory.
would return the drive letter and colon:
Note that JustDrive() does not check whether the drive actually exists, it just processes the string passed in as a parameter. The JustDrive() function will return the first two characters from the string if the second of these is a colon. If the second character is not a colon then the function will return an empty string. As an example of the problems that this can cause, the use of a valid UNC network path such as:
would return the empty string:
We have found that the JustDrive() function is of limited use. The only time that we have found it useful is when an older application has had to run on a variety of machines, each of which had the server mapped to a different drive letter.
Microsoft Access does not have equivalents to these FoxPro file name commands so I wrote this library Visual Basic functions to do give me the same facilities in VBA.