How to modify the shortcut to the front end/security through VBA code

M

mpfohl

I have a secured front end and backend database I'd like to distribute
over my network to many computers. The backend will be on the server,
each user will get their own version of the front end to be placed on
their C drive.

I'd like to find a way through VBA code in a separate MS access
database with a form button that says 'install' to do the following:

1) copy the front end database from the shared drive to a specific
location on the C drive (I think I can do that with CopyObject()
method)

2) Copy the shortcut that links the Front End to the security file to
the user's desktop (again, I think copyobject() method will work)

3) Modify the path of the shortcut to point to the user's new Front
end after prompting for it's location. I know how to prompt for the
location, I just don't know how to modify the shortcut's 'pointer'.

It is question 3 I'm most stuck on, any suggestions?
 
K

Keith Wilby

I have a secured front end and backend database I'd like to distribute
over my network to many computers. The backend will be on the server,
each user will get their own version of the front end to be placed on
their C drive.

I'd like to find a way through VBA code in a separate MS access
database with a form button that says 'install' to do the following:

1) copy the front end database from the shared drive to a specific
location on the C drive (I think I can do that with CopyObject()
method)

2) Copy the shortcut that links the Front End to the security file to
the user's desktop (again, I think copyobject() method will work)

3) Modify the path of the shortcut to point to the user's new Front
end after prompting for it's location. I know how to prompt for the
location, I just don't know how to modify the shortcut's 'pointer'.

It is question 3 I'm most stuck on, any suggestions?

Why not use a batch file to copy the FE to the user's profile? That way it
would always be in the same place, no prompting necessary.

XCOPY "\\MyPath\MyFE.mde" "%userprofile%\MyFolder" /I

Keith.
www.keithwilby.com
 
M

mpfohl

I don't think I can just copy the file over.

I'm going to store the FE in the users MyDocuments, which means the
full path name to my documents includes their username, so each
person's path will be unique, thus each person's shortcut pointing to
the FE will be uniqute. I don't think there is a way to address that
through xcopy, is there? I really just need to be able to modify one
small portion of the short cut tartget and it'll all make sense. What
am I missing?
 
K

Keith Wilby

I don't think I can just copy the file over.

Why not? It's exactly what I do and it works a treat. You're making a rod
for your own back by having each user's path unique, it'll be a nightmare of
an overhead. This is my setup:

BE in a server folder, all users have RWXD permissions. FE in a read-only
"Public" folder. Users shortcuts point to a batch file, example:

ECHO OFF
DEL "%userprofile%\MyDBFolder\*.*" /Q
XCOPY "\\MyServer\KeithWilby\Public\ma.mde" "%userprofile%\MyDBFolder" /I
START "MA" /MAX "C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE"
"%userprofile%\MyDBFolder\ma.mde" /wrkgrp
"\\MyServer\Barrow\Ast\MADB\MADB.mdw"

This ensures that the latest version of the FE is copied from my Public
folder to the same location for each user and then opened on a session by
session basis. Is this not what you want?

Keith.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top