Public Function MakeFEShortcut() 'Purpose : Creates/overwrites shortcut to launch front end. Dim Shortcut, DesktopPath, StartupPath Dim MSAccPath 'Possible Not needed JM 06-09-2021 On Error Resume Next 'Kill shortcut so icon will be default Access icon. If fs.FileExists(cLOCPATH & "\" & cSCName & ".lnk") Then fs.DeleteFile cLOCPATH & "\" & cSCName & ".lnk", True End If 'Create shortcut in same folder as FE. Set Shortcut = WSHShell.CreateShortcut(cLOCPATH & "\" & cSCName & ".lnk") 'Access Path Code possibly not applicable due to Access Runtime JM 06-09-2021 'Get msaccess path 'MSAccPath = WSHShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\" _ '& "CurrentVersion\App Paths\MSACCESS.EXE\Path") 'If Err <> 0 Then ' MsgBox "MS Access is not installed. Installation aborted." ' Set Shortcut = Nothing ' Err = 0 ' Exit Function 'End If Shortcut.TargetPath = """" & MSAccPath & "\msaccess.exe" & """" '?? Shortcut.arguments = """" & cLOCPATH & "\" & cFE & """" '?? StartupPath = MSAccPath If fs.FolderExists(StartupPath) Then Shortcut.WorkingDirectory = StartupPath End If Shortcut.Description = "Application" 'Commented out. Use default Access Icon for this shortcut. 'Shortcut.IconLocation = cLOCPATH & "\" & cICON Shortcut.Save Set Shortcut = Nothing MakeFEShortcut = True End Function
Public Function MakeDesktopShortcut(sName, target) 'Purpose : Create new desktop shortcut in case something has changed. Dim Shortcut, DesktopPath, StartupPath DesktopPath = WSHShell.SpecialFolders("Desktop") Set Shortcut = WSHShell.CreateShortcut(DesktopPath & "\" & sName & ".lnk") Shortcut.TargetPath = target StartupPath = fs.GetParentFolderName(target) If fs.FolderExists(StartupPath) Then Shortcut.WorkingDirectory = StartupPath End If Shortcut.IconLocation = cLOCPATH & "\" & cICON Shortcut.Save End Function
If your users actually have permissions to top level C:\, I have no particular objection. I've gotten into the habit of using AppData as something that seems to universally work pretty well on Windows 10, in all types of environments (restrictive/corporate, open/small business, etc).Is that anything special or can I just generate a top level C:\DBNAME directory and drop everything in there?
Honestly, just because it was faster to codeAlso, why does everyone delete everything and recopy, is that to avoid the Windows dialog box prompt?
delete entire local database folder create entire local database folder copy latest server version of db into it
See if local db folder already exists, if not create it If it exists, see if there is a db already in there, if so, delete it Possibly double check if there is additional crap/leftovers in there, if so, delete them Copy latest server version of db into it