473,416 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Ensure User Launches from Local Front End

RE: Access 2003

My application has been split and the front end runs on client PCs with the
back end on a LAN file server. Also I have an updater routine that copies
an updated client from the LAN file server to the client PCs when needed. I
keep the client front end on the LAN server for distribution purposes. The
problem is that occasionally, user's get confused and go to the LAN file
server and run the application from the front end file that is on the LAN
server. I want them to use their client front end on their PC. I plan to
add code to check for this (see below). Is there a better way to do this?

John
Sub ClientLocal()
On Error GoTo Err_ClientLocal

' Quits if the user launches the application from a LAN file.
' Should launch from a client on users PC.

Dim strDrive As String
Dim strMessage As String
Dim strTitle As String

strDrive = Left(CurrentDb.name, 1)

strTitle = "Login Error"
strMessage = "It appears that you have launched the application from a
LAN file location."
strMessage = strMessage & "Please consult your system administrator.
Application terminating."

If strDrive "D" Then
MsgBox strMessage, vbCritical, strTitle
Quit
End If

Exit_ClientLocal:
Exit Sub

Err_ClientLocal:
MsgBox Err.Description
Resume Exit_ClientLocal

End Sub
Apr 7 '07 #1
8 1783
On Apr 7, 4:28 pm, "JohnC" <anonym...@news.groups.comwrote:
RE: Access 2003

My application has been split and the front end runs on client PCs with the
back end on a LAN file server. Also I have an updater routine that copies
an updated client from the LAN file server to the client PCs when needed. I
keep the client front end on the LAN server for distribution purposes. The
problem is that occasionally, user's get confused and go to the LAN file
server and run the application from the front end file that is on the LAN
server. I want them to use their client front end on their PC. I plan to
add code to check for this (see below). Is there a better way to do this?

John

Sub ClientLocal()
On Error GoTo Err_ClientLocal

' Quits if the user launches the application from a LAN file.
' Should launch from a client on users PC.

Dim strDrive As String
Dim strMessage As String
Dim strTitle As String

strDrive = Left(CurrentDb.name, 1)

strTitle = "Login Error"
strMessage = "It appears that you have launched the application from a
LAN file location."
strMessage = strMessage & "Please consult your system administrator.
Application terminating."

If strDrive "D" Then
MsgBox strMessage, vbCritical, strTitle
Quit
End If

Exit_ClientLocal:
Exit Sub

Err_ClientLocal:
MsgBox Err.Description
Resume Exit_ClientLocal

End Sub
Hi, John.

If the environment in which you operate is sufficiently homogeneous
that you can be sure that any drive letter above D: will be a mapped
drive to a network share then your approach is fine.

However, if you are in an environment where some workstations may have
local drives above D: because of multiple hard drives, multiple
partitions, SUBST'ed drives etc., then simply checking the drive
letter may not be sufficient. If that is true and if you are able to
use the Windows Script Host Object Model (wshom.ocx) you might try
using the EnumNetworkDrives method of the WshNetwork object, as in:

Sub ShowNetworkDrives()
Dim wshNet As New WshNetwork
Dim NetworkDrives As WshCollection
Dim thing As Variant

Set NetworkDrives = wshNet.EnumNetworkDrives

If NetworkDrives.Count = 0 Then
MsgBox "There are no mapped network drives"
Else
For Each thing In NetworkDrives
MsgBox thing & " is a network drive"
Next
End If

Set NetworkDrives = Nothing
Set wshNet = Nothing
End Sub

Apr 7 '07 #2

"JohnC" <an*******@news.groups.comwrote in message
news:a1**************************@EVERESTKC.NET...
RE: Access 2003

My application has been split and the front end runs on client PCs with
the back end on a LAN file server. Also I have an updater routine that
copies an updated client from the LAN file server to the client PCs when
needed. I keep the client front end on the LAN server for distribution
purposes. The problem is that occasionally, user's get confused and go to
the LAN file server and run the application from the front end file that
is on the LAN server. I want them to use their client front end on their
PC. I plan to add code to check for this (see below). Is there a
better way to do this?

John
Sub ClientLocal()
On Error GoTo Err_ClientLocal

' Quits if the user launches the application from a LAN file.
' Should launch from a client on users PC.

Dim strDrive As String
Dim strMessage As String
Dim strTitle As String

strDrive = Left(CurrentDb.name, 1)

strTitle = "Login Error"
strMessage = "It appears that you have launched the application from a
LAN file location."
strMessage = strMessage & "Please consult your system administrator.
Application terminating."

If strDrive "D" Then
MsgBox strMessage, vbCritical, strTitle
Quit
End If

Exit_ClientLocal:
Exit Sub

Err_ClientLocal:
MsgBox Err.Description
Resume Exit_ClientLocal

End Sub
Why don't you place a shortcut on their desktop which is linked to the one
on their PC?

Apr 7 '07 #3
JohnC wrote:
>RE: Access 2003

My application has been split and the front end runs on client PCs with the
back end on a LAN file server. Also I have an updater routine that copies
an updated client from the LAN file server to the client PCs when needed. I
keep the client front end on the LAN server for distribution purposes. The
problem is that occasionally, user's get confused and go to the LAN file
server and run the application from the front end file that is on the LAN
server. I want them to use their client front end on their PC. I plan to
add code to check for this (see below). Is there a better way to do this?

If you place the master FE copy in the same folder as the BE
database, then you can check if the path to the BE and FE
folders are the same. (air code)

Dim strBEpath As String
With CurrentDb()
strBEpath = Mid(db.TableDefs!anylinkedtable.Connect, 11)
strBEpath = Left(strBEpath, InStrRev(strBEpath, "\") - 1)
If strBEpath = CurrentProject.Path Then
MsgBox . . .
Application.Quit acQuitSaveNone
End If
End With

--
Marsh
MVP [MS Access]
Apr 7 '07 #4
On Apr 7, 6:47 pm, Marshall Barton <marshbar...@wowway.comwrote:
JohnC wrote:
RE: Access 2003
My application has been split and the front end runs on client PCs with the
back end on a LAN file server. Also I have an updater routine that copies
an updated client from the LAN file server to the client PCs when needed. I
keep the client front end on the LAN server for distribution purposes. The
problem is that occasionally, user's get confused and go to the LAN file
server and run the application from the front end file that is on the LAN
server. I want them to use their client front end on their PC. I plan to
add code to check for this (see below). Is there a better way to do this?

If you place the master FE copy in the same folder as the BE
database, then you can check if the path to the BE and FE
folders are the same. (air code)

Dim strBEpath As String
With CurrentDb()
strBEpath = Mid(db.TableDefs!anylinkedtable.Connect, 11)
strBEpath = Left(strBEpath, InStrRev(strBEpath, "\") - 1)
If strBEpath = CurrentProject.Path Then
MsgBox . . .
Application.Quit acQuitSaveNone
End If
End With

--
Marsh
MVP [MS Access]
I think you can avoid having users use the network copy by making the
folder where it resides "read only". When we began using our
application on the network this was a glitch for us.
Apr 8 '07 #5
"Dennis" <de***********@gmail.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
On Apr 7, 6:47 pm, Marshall Barton <marshbar...@wowway.comwrote:
>JohnC wrote:
>RE: Access 2003
>My application has been split and the front end runs on client PCs with
the
back end on a LAN file server. Also I have an updater routine that
copies
an updated client from the LAN file server to the client PCs when
needed. I
keep the client front end on the LAN server for distribution purposes.
The
problem is that occasionally, user's get confused and go to the LAN file
server and run the application from the front end file that is on the
LAN
server. I want them to use their client front end on their PC. I plan
to
add code to check for this (see below). Is there a better way to do
this?

If you place the master FE copy in the same folder as the BE
database, then you can check if the path to the BE and FE
folders are the same. (air code)

Dim strBEpath As String
With CurrentDb()
strBEpath = Mid(db.TableDefs!anylinkedtable.Connect, 11)
strBEpath = Left(strBEpath, InStrRev(strBEpath, "\") - 1)
If strBEpath = CurrentProject.Path Then
MsgBox . . .
Application.Quit acQuitSaveNone
End If
End With

--
Marsh
MVP [MS Access]

I think you can avoid having users use the network copy by making the
folder where it resides "read only". When we began using our
application on the network this was a glitch for us.

Thanks for all the replies and good suggestions. If I make the folder "read
only" I believe they can still open the FE MDB but only in "read only" as
there will be no .ldb file. Correct?

Can I make the master FE "hidden"? Not by using file attributes because
that is too easy to view hidden files. We are using Windows Server. Does
Windows Server have some way to hide files? I think Novell uses a dollar
sign.

John
Apr 8 '07 #6
JohnC wrote:
Thanks for all the replies and good suggestions. If I make the
folder "read only" I believe they can still open the FE MDB but only
in "read only" as there will be no .ldb file. Correct?

Can I make the master FE "hidden"? Not by using file attributes
because that is too easy to view hidden files. We are using Windows
Server. Does Windows Server have some way to hide files? I think
Novell uses a dollar sign.
You can make the share hidden (dollar sign).

You can make the file have acompletely different name and have the script that
copies it rename it at the same time.

You can check the folder being run from in your startup code.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Apr 8 '07 #7
On Apr 7, 6:47 pm, Marshall Barton <marshbar...@wowway.comwrote:
JohnC wrote:
RE: Access 2003
My application has been split and the front end runs on client PCs with the
back end on a LAN file server. Also I have an updater routine that copies
an updated client from the LAN file server to the client PCs when needed. I
keep the client front end on the LAN server for distribution purposes. The
problem is that occasionally, user's get confused and go to the LAN file
server and run the application from the front end file that is on the LAN
server. I want them to use their client front end on their PC. I plan to
add code to check for this (see below). Is there a better way to do this?

If you place the master FE copy in the same folder as the BE
database, then you can check if the path to the BE and FE
folders are the same. (air code)

Dim strBEpath As String
With CurrentDb()
strBEpath = Mid(db.TableDefs!anylinkedtable.Connect, 11)
strBEpath = Left(strBEpath, InStrRev(strBEpath, "\") - 1)
If strBEpath = CurrentProject.Path Then
MsgBox . . .
Application.Quit acQuitSaveNone
End If
End With

--
Marsh
MVP [MS Access]
Marsh,

Can you help me with my question? Posted within this forum
(comp.databases.ms-access), Subject is Sync subform. Thanks!

Apr 9 '07 #8

"Marshall Barton" <ma*********@wowway.comwrote in message
news:lv********************************@4ax.com...
JohnC wrote:
>>RE: Access 2003

My application has been split and the front end runs on client PCs with
the
back end on a LAN file server. Also I have an updater routine that copies
an updated client from the LAN file server to the client PCs when needed.
I
keep the client front end on the LAN server for distribution purposes. The
problem is that occasionally, user's get confused and go to the LAN file
server and run the application from the front end file that is on the LAN
server. I want them to use their client front end on their PC. I plan
to
add code to check for this (see below). Is there a better way to do
this?


If you place the master FE copy in the same folder as the BE
database, then you can check if the path to the BE and FE
folders are the same. (air code)

Dim strBEpath As String
With CurrentDb()
strBEpath = Mid(db.TableDefs!anylinkedtable.Connect, 11)
strBEpath = Left(strBEpath, InStrRev(strBEpath, "\") - 1)
If strBEpath = CurrentProject.Path Then
MsgBox . . .
Application.Quit acQuitSaveNone
End If
End With

--
Marsh
MVP [MS Access]
Perfect! Very elegant. Thank you Marshall.

John
Apr 11 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Konstantinos | last post by:
I cant find much info or a code on how to do this. I have a generic table called Contact. Then I have tables Person and Company that are subtypes of contact each with attributes that are specific...
5
by: premmehrotra | last post by:
I currently have a multi-user access database which is put on a shared drive L: on a Windows Servers. Entire database is one file premdb.mdb. Users access this database from their laptops....
12
by: Paul H | last post by:
Say I have a Windows 2000 server running Terminal Services with a single file Access DB (not front end/back end) on it, could multiple users access the data base simultaneously? Paul
2
by: alexandre.abric | last post by:
Hello everyone ! I am currently working on a 3-tiers application, accessing Oracle with given stored procedures. The presentation layer is WinForms and WebForms, and they call Web Services to...
45
by: Luvin lunch | last post by:
Hi, I'm new to Access and have been asked to develop a simple Access system to replace one that already exists. There are five users of the current Access system and each of the users works off...
3
by: Lattis | last post by:
I have the following problem: User A is logged in to a windows 2000 terminal. He runs an application which runs under the credentials of a different user. If I try to see the current user...
12
by: Dilip | last post by:
Hi All I have a server based C# console application. This application must hide its console window when its launched out on the field. So I dutifully P/Invoke'd FindWindow/ShowWindow...
2
by: Bruce | last post by:
Hello all, I have an annoyance that is common to all of the Access 2003 applications I manage. All of the applications are split front end/ back end with a front end copy on each client...
31
by: zdenko | last post by:
I have a multi user database and users were created by user level security wizzard - as I mentioned in message before. Everything works fine for those users, but now I have another problem. I have...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.