|
|
CODE ' Code courtesy of UtterAccess Wiki ' http://www.utteraccess.com/wiki/index.php/Category:FunctionLibrary ' Original submission by Pacala_Ba ' 2010, August 11th ' ' You are free to use it in any application, ' provided this copyright notice is left unchanged. ' ' ' --------------------- Example calls ----------------- '? Sys_AC_VerifyDrivesLocation( _ ' CurrentProject.FullName, _ ' gkc_DriveFrontEnd, _ ' "DriveFrontEnd",bAC_Quit:=False) ' '? Sys_AC_VerifyDrivesLocation( _ ' syscmd(acSysCmdGetWorkgroupFile), _ ' gkc_DriveUserEnd, _ ' "WorkgroupFile",bAC_Quit:=False) ' ' 'Example constants used for arguments: 'Public Const gkc_DriveFrontEnd = "C" ' DATABASE CONTROLS WITHOUT TABLES 'Public Const gkc_DriveTempEnd = "D" ' DATABASE USER TEMPORARY TABLES 'Public Const gkc_DriveBackEnd = "Z" ' DATABASE TABLES 'Public Const gkc_DriveUserEnd = "Z" ' DATABASE SECURE WorkgroupFile ' ' ' Public Function Sys_AC_VerifyDrivesLocation(cDriveCurrent As String, _ cDriveRequired As String, Optional cMsgText As String = "", _ Optional bAC_Quit As Boolean = False, _ Optional cNote As String = "Input: Drive/Path") As Boolean On Error GoTo LBL_xPAC_ERR Dim ll_Ret As Boolean ll_Ret = ((Len(Left$(Trim$(cDriveCurrent), 1)) = 1) And _ (StrComp(Left$(cDriveCurrent, 1), Left$(cDriveRequired, 1), vbTextCompare) = 0)) If Not ll_Ret Then MsgBox "**INVALID** DriveLocation !" & vbCrLf & _ "DriveCurrent : " & Left$(cDriveCurrent, 1) & vbCrLf & _ "DriveRequired : " & Left$(cDriveRequired, 1) & vbCrLf & cMsgText, _ vbCritical, "Sys_AC_VerifyDrivesLocation" If bAC_Quit Then Application.Quit End If End If LBL_xPAC_END: Sys_AC_VerifyDrivesLocation = ll_Ret Exit Function LBL_xPAC_ERR: MsgBox "Err: " & Err & "," & Err.Description, vbCritical, "Sys_AC_VerifyDrivesLocation" Resume LBL_xPAC_END Resume Next Resume End Function
|
| This page was last modified 09:43, 6 April 2011. This page has been accessed 756 times. Disclaimers |