Distributing MS Access database file with Creating an application shortcut

masoud_sedighy

Registered User.
Local time
Today, 05:23
Joined
Dec 10, 2011
Messages
132
Hi


I read in the book (Access 2013 inside out), one of the way to distributing access database is creating an application shortcut.
now i have an Access 2013 file on my computer (with office 2013 and windows 7) other users have office 2007 and windows (XP) on their computers. now i want to give a copy of this file to other users without save as that to 2007.
i would like to know how i can do that with creating an application shortcut , if it is possible because in the book i could not find the way if there is?
 
Depends on how you want to do this.
'For this code to execute you must add a reference to the
'Windows Script Host Object Model (WSHOM.OCX).
'Uses module basShortCut

Call CreateDesktopShortcut("YourDatabaseNameHere")

Option Compare Database
Option Explicit

Public Sub CreateDesktopShortcut(strShortcutTitle As String, _
Optional strTargetPath As String = "")
On Error Resume Next

Dim oShell As IWshShell_Class
Dim oShortcut As IWshShortcut_Class
Dim vItem As Variant
Dim vType As Variant

Set oShell = New IWshShell_Class

If strTargetPath = "" Then
strTargetPath = CurrentDb.Name
End If

For Each vItem In oShell.SpecialFolders
If Mid(vItem, Len(vItem) - 6, 7) = "Desktop" And _
InStr(1, vItem, "All Users") = 0 And _
InStr(1, UCase(vItem), "ADMINISTRATOR") = 0 Then
Set oShortcut = oShell.CreateShortcut(vItem & "\" & strShortcutTitle & ".lnk")
oShortcut.TargetPath = strTargetPath
oShortcut.Save
End If
Next

End Sub

HTH
 
If your users dont have the same version of access you will have to install the access runtime.
 

Users who are viewing this thread

Back
Top Bottom