Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make sure all of the users are using the most current version of the front end? - alternate method

Multi User Databases

How to make sure all of the users are using the most current version of the front end? - alternate method

by  fdalmoro  Posted    (Edited  )
I saw another FAQ on this topic but I think it's too complicated for a beginner. I think this way is a lot easier.

1. Make a vbs script that will compare the file modified date between a network master frontend and a local copy, and will copy the newer file down to the local computer only if it's newer than the local. Put this vbs script somewhere on the network where the users can access it. This is an example of what I use.

Code:
Function Update( source, target )
Dim f1,f2,d1,d2,c1,c2
  If fs.FileExists( source ) then  
	set f1 = fs.GetFile( source )   
	d1 = f1.DateLastModified   
	c1 = Year(d1) * 10000 + Month(d1) * 100 + Day(d1)   
	If fs.FileExists( target ) then      
		set f2 = fs.GetFile( target )      
		d2 = f2.DateLastModified      
		c2 = Year(d2) * 10000 + Month(d2) * 100 + Day(d2)   
	Else      
		c2 = 0   
	End If   
	If c1 > c2 then     
	' overwrite local copy with the network version
		f1.Copy target,True   
	End If
  End If
End Function

Dim fs
set fs = WScript.CreateObject("Scripting.FileSystemObject")
s = "\\servername\servershare\mastermdbname"
t = "C:\mdbname"
Update s, t

2. On the user's desktop create a SHORTCUT to the vbs and put it in the startup folder in the start menu. DO NOT COPY THE SCRIPT TO THE STARTUP FOLDER. I prefer not to copy the vbs to the startup because if you ever decide to modify the vbs, you only do it once.

3. Run the script once by logging out then back in or by clicking on the shortcut that you just put in the startup. This will copy the initial front end to c:.

4. Create a shortcut to c:\mdbname on the desktop, quick launch or start menu.

You are now ready to launch the database.

*****NOTES*****
Do not run the vbs script when you have the database open. That's why it's better to keep it in your startup to avoid double executions and so on.
***************

What this allows also is continuing development and modifications to the mdb fronend program while users are accessing the data without interruptions and faster launch times.

Have Fun,

Fernando
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top