Check where front end is installed (1 Viewer)

Mclaren

Registered User.
Local time
Today, 01:05
Joined
Mar 28, 2007
Messages
13
I would like to be able to check whether my front end is being opened from the PC on which it resides or if someone is accessing it from a network.

In other words, i want the front end to display an msgbox to a person if that person tries to access it from a machine other than the one the front end resides.

I am contemplating using current machine name code to check, but would like to now if there is another approach.
 

DCrake

Remembered
Local time
Today, 09:05
Joined
Jun 8, 2005
Messages
8,632
A database I created for a department has this functionality. They had a bad habit of trying to open the front that was used for deployment purposes which was located on the server. So I wrote some code to combat this.

Code:
Private Sub Form_Load()
If Left(CurrentProject.Path, 1) = "J" Then
         Msg = "You cannot load the application using the copy" & vbCrLf
   Msg = Msg & "located on the J Drive." & vbCrLf
   Msg = Msg & "You should be opening the program via a shortcut on your"
   Msg = Msg & "desktop that points to Access database located in:"
   Msg = Msg & "Path: C:\Program Files\SaltDatabase"
   Msg = Msg & "File: SALT.mdb"
   
   MsgBox Msg, vbExclamation + vbOKOnly, "Illegal Access Point"
   DoCmd.Quit
End If

So on the on load of the start up form it checked where it was being opened from, if it was the server version it they a dialog box up.
 

ghudson

Registered User.
Local time
Today, 04:05
Joined
Jun 8, 2002
Messages
6,195
What if they are using the UNC to access the server in windows explorer [instead of a fix drive mapping]? I would instead test if the opened application is not located on the users computer.

Code:
If CurrentProject.Path <> "C:\Program Files\SaltDatabase\" Then
 

DCrake

Remembered
Local time
Today, 09:05
Joined
Jun 8, 2005
Messages
8,632
As I knew they would not be using the UNC that is why I used the method I did. If you can offer the UNC solution it could be incorperated. Firstly though you would need to detect if it was using UNC of fixed drive mapping.
 

Users who are viewing this thread

Top Bottom