Jump: Search:

Total Visual SourceBook

Total Visual SourceBook CD and Printed Manual

Microsoft Access 2007/2010 Version
is Shipping!

New features in Total Visual SourceBook for Access, Office 2007 and VB6

Supports Access/Office 2010 (32 bit), 2007, 2003, 2002, 2000, and
Visual Basic 6.0!

Also available for:
Access 97/95


View all FMS products for Microsoft AccessAll Our Microsoft Access Products

SourceBook Info:

Why SourceBook?

 

"The code is exactly how I would like to write code and the algorithms used are very efficient and well-documented."

Van T. Dinh, Microsoft MVP

 

 

 

 

 
Royalty free source code library modules for Microsoft Access, VB6, VBA, OfficeRoyalty free source code library modules for Microsoft Access, VB6, VBA, OfficeVBA and VB6 Source Code Library Download the free trial version of Total Visual SourceBook for Microsoft Access, Office, VB6 and VBA
Category: General VBA/VB6 : File and Disk Operations
Description: Managing disk drives, files, paths, folders, and subfolders with and without Windows API calls

Module: modAPIFilesAndPaths

Working with drives, paths, and files using the Windows API

Procedure Name

Type

Description

(Declarations) Declarations Declarations and private variables for the modAPIFilesAndPaths module
ConvertPathToUNC Procedure Converts the named path to its universal naming convention (UNC) representation. This function returns the full UNC (Universal Naming Convention) path for the given file system path. For example, assume that your F: drive is mapped to a shared network drive on your server named "dev". The UNC mapping for this would be \\dev\directoryname where directoryname is the name of the directory the drive is mapped to. If you specify a path and a file name and extension for the strFileName argument, the file name and extension are returned along with the UNC path. If the path you pass is not a mapped network drive, this procedure calls the Windows API to get your computer name. This name becomes the root of the UNC path. For example, if your computer is named "MyComp", and your C drive has the label "MyC", the UNC path would be \\MyComp\MyC.
DriveFromPath Procedure Returns the drive letter part of the path. This is a provate helper function that supports other procedures in this module.
FilesToArrayAPI Procedure Populates the passed array with a list of files in the specified directory. This search is extremely fast compared to other searches. It is considerably faster than using the Windows Search dialog as well.
GetFileHandle Procedure Open a file to get a handle to it. We then use this handle for other calls. This function may fail if the file is already opened.
GetFileSize Procedure Returns the size of the specified file in bytes
GetFileTime Procedure Returns the specified file time for the specified file. To specify the type of time you want returned, use the appropriate EnumFileTimeType value.
GetFileVersion Procedure Returns the version information from a file such as a DLL, EXE, OCX, etc.
GetLongFileName Procedure Returns the full path and name of a file in long file name format, given a path in DOS compatible short file name format.
GetShortFileName Procedure Gets the DOS-compatible short file name version of a long file name
NullTerminatedStringToArray Procedure Converts a null-terminated string to the passed array
PathFromFullPath Procedure Returns the remainder of a path after the drive letter
SetFileTime Procedure Sets the specified time on the specified file
SubDirsToArrayAPI Procedure Populates the passed array with a list of subdirectories in the specified directory
SystemTimeToVBATime Procedure Converts the Windows SYSTEMTIME struct to a VBA Date type
VBATimeToFileTime Procedure Converts the passed date value to the Windows FILETIME structure. When calling the Windows API to work with file times, you must convert to and from VBA Date type serial values and the appropriate Windows time structure. This procedure converts a VBA Date type serial date to the Windows SYSTEMTIME structure.
VBATimeToSystemTime Procedure Converts the supplied VBA date/time value to the Windows SYSTEMTIME struct
WinTimeToVBATime Procedure Converts the Windows FILETIME struct to a VBA Date type. When calling the Windows API to work with file times, you must convert to and from VBA Date type serial values and the appropriate Windows time structure. This procedure converts a Windows FILETIME structure to a VBA-compatible Date type serial date.

Overview of Total Visual SourceBook

The source code in Total Visual SourceBook includes modules and classes for Microsoft Access, Visual Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily add this professionally written, tested, and documented royalty-free code into your applications to simplify your application development efforts.

Additional Resources

Feedback

Contact Us  l   Web questions: Webmaster   l   Copyright © FMS, Inc., Vienna, Virginia
Celebrating our 26th Year of Software Excellence