Kefash
Kefash

Reputation: 533

How to make a batch file that update Frontend in MS Access?

I have been looking for a simple solution to deploy and replace frontend of MS Access database when Changes are made to frontend copy on the server. I have only found one solution on the internet by Danny J. Lesandrini that accomplish this but I'm unable to deploy to more than one computer on the network as the file's address is unavoidably hard coded.

The other method I considered base on my reading is to create a batch file that compare the frontend on the client's computer with the one on the server and if different replace the client's frontend with the server's frontend. (this method I would prefer)

The problem is I don't know how to accomplish this and I have not found any sample anywhere to modify to meet my objective. Honestly, I've never created a batch file before but I'm up for learning this with any aid possible. :)

Upvotes: 1

Views: 1950

Answers (1)

Johnny Bones
Johnny Bones

Reputation: 8404

You can easily create a Version Checker in Access. I have one that looks at the Description property of a form:

FileName = Nz(DLookup("Value", "CMDB_tblScreenOptions", "OptionName = 'VersionFilename'"))
CurrentVer = CurrentDb.Containers("Forms").Documents("CMDB_frmScreenAbout").Properties("Description")

FileName, in this case, was kept in a table which had it's property set to Hidden. It stored the path to the text file that I kept the version in. It would then open that text file:

Open FileName For Input As #1
Do While Not EOF(1)
    Input #1, FileVer
Loop
Close #1

If CurrentVer = FileVer, everything is fine. If not, it shells out to a BAT file and then closes the database. The BAT file has a PAUSE line which gives the user time to allow the DB to close, and then after they "press 'Enter' to continue..." it grabs the current version from the network and installs it on the user's computer.

It sounds a little complicated, but once you figure it out you'll end up using it in every app you create and it becomes easy to incorporate.

Upvotes: 2

Related Questions