Subj: Computer name from API Section: Windows API To: IDDC, 101330,2563 Tuesday, January 26, 1999 7:36:31 PM From: Calvin G. Smith, 102226,2127 #726219 Hi Anthony! >>> Can you suggest a method of reading the volume serial number in MSAccess 7/97? <<< Yes, the following will work: Private Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long Function ReturnVolumeSerialNumber$(strDrive$) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'Author: Calvin Smith 'Environment: MS VB v5.0 'WEB: http://www.CalvinSmithSoftware.com ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' On Error GoTo ReturnVolumeSerialNumber_Err '32-Bit Usage: strRetVal$ = ReturnVolumeSerialNumber$("C:\") Dim strVolumeBuffer$ Dim strSysName$ Dim lSerialNum& Dim lSysFlags& Dim lComponentLength& Dim lRetVal& strVolumeBuffer$ = String$(256, 0) strSysName$ = String$(256, 0) lRetVal& = GetVolumeInformation(strDrive$, strVolumeBuffer$, 255, lSerialNum&, _ lComponentLength&, lSysFlags&, strSysName$, 255) If lRetVal& = 0 Then ReturnVolumeSerialNumber = "Unable to retrieve volume information" Else ReturnVolumeSerialNumber = "The VSN of " & strDrive$ & " is: " & lSerialNum& End If ReturnVolumeSerialNumber_Exit: Exit Function ReturnVolumeSerialNumber_Err: If Err Then 'Do whatever you need to here! Resume ReturnVolumeSerialNumber_Exit End If End Function >>> Thank you in advance <<< You're welcome! :-) Calvin Smith - Sr. Visual Basic/MS Access Consultant ******************************************************** WEB: http://www.CalvinSmithSoftware.com ********************************************************