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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy new network Access front end to C:\ 1

Status
Not open for further replies.

Quehay

Programmer
Feb 6, 2000
804
US
I have user groups that have a front end that lives in a dedicated network folder. Ideally they should download the front end to PC to reduce network traffic. There are inevitable changes to every project, however, due to sponsor requests.

Question: I'd like to create a script that would live on user PC and check to see if new version is in \\ntwk\dbfolder, then copy over existing PC version if so.

TIA
 

Quehay,

You need to first check the Last modified dates of both files, then compare the date values. It should look something like this.

Fengshui1998


Set fso = CreateObject("Scripting.FileSystemObject")
src = "\\ntwk\dbfolder\filename"
dest = "C:\dbfolder\filename"

Set srcatt = fso.GetFile(src)
Set destatt = fso.GetFile(dest)
if datevalue(srcatt.DateLastModified) > datevalue(destatt.DateLastModified) then
msgbox "Source is more recent."
' start copying here
else
msgbox "Source is the same or older."
' Leave it alone
end if
 
THANK YOU FENG SHUI!!

I figured it would involve comparing the date modified, but I didn't know any of the stuff you offer here. I'll give this a try.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top