Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Multiuser / Networking / November 2004

Tip: Looking for answers? Try searching our database.

Batch script to check username

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jonefer - 20 Nov 2004 01:43 GMT
I once got help writing a script that referenced the username
to determine whether or not to copy a MASTER.mdb to c:\LocalCopy\FrontEnd.mdb

The script, checked a folder for a dummy file with extension .upd for example:
username.upd

(The folder had files - user1.upd, user2.upd, user3.upd)
If it found the username.upd it would copy the master.mdb to their local
folder
as an updated front end.

All the DBA would have to do is to delete the username.upd file in the
UserUpdate folder, in order to initiate a "push" to desired users for the
update.

code should go something like this:
====================================
if exist "\\Disk1\UserUpdates\username.upd" GOTO UpdateUser

:UserCurrent
ECHO user is already current
:UpdateUser
copy "N:\MasterFrontEnd\Master.mdb" "C:\FrontEnd\FrontEnd.mdb
...write a new username.upd  in the UserUpdate folder
...start the FrontEnd.mdb
ECHO user is now current
=======================

I just need help with determining the username so I can check for as well as
write the dummy username.upd file.
Graham R Seach - 21 Nov 2004 07:41 GMT
I assume you're talking about the Windows domain username. If so, try one of
the following in VBA:
   http://www.pacificdb.com.au/MVP/Code/GetLoginName.htm
   http://www.pacificdb.com.au/MVP/Code/UserInfoClass.htm

If you're talking about the Access username, then this should do:
   sMyUser = Access.CurrentUser

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

>I once got help writing a script that referenced the username
> to determine whether or not to copy a MASTER.mdb to
[quoted text clipped - 29 lines]
> as
> write the dummy username.upd file.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.