It's easier than you think. I will post up the code etc. you need in a little while (just heading out of the office for a bit!).
Dim strVerClient As String, strVerServer As String
strVerClient = Nz(DLookup("[VersionNumber]", "[tbl_VersionClient]"), "")
strVerServer = Nz(DLookup("[VersionNumber]", "[tbl_VersionServer]"), "")
If strVerClient <> strVerServer Then
'This copy of the FE is out of date and we need to get the latest version
Dim strSourceFile As String, strDestFile As String
Dim strAccessExePath As String, lngResult As Long
'Create the source's path and file name.
strSourceFile = "\\YourServerOrNasPath\FolderWhereMasterFEisKept\NameOfYourDatabase.mdb"
strDestFile = CurrentProject.FullName
'Determine path of current Access executable
strAccessExePath = SysCmd(acSysCmdAccessDir) & "MSAccess.exe "
If Dir(strSourceFile) = "" Then 'Something is wrong and the file is not there.
MsgBox ("Please see system administrator")
Else 'copy the new version of app over the existing one.
lngResult = apiCopyFile(strSourceFile, strDestFile, False)
End If
'Modify strDestFile slightly so that it can be used with the Shell function
strDestFile = """" & strDestFile & """"
MsgBox "Application Updated. Please wait while the application restarts.", vbInformation, "Update Successful"
'Load new version, then close old one.
Shell strAccessExePath & strDestFile & "", vbMaximizedFocus
DoCmd.Quit
End If
Declare Function apiCopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long
OK, code and process for updating User FE databases:
In your BE database, create a table called tbl_VersionServer, with a text field called VersionNumber. This is where you enter the latest version number of your application.
In your FE database, create a local table called tbl_VersionClient, with a text field called VersionNumber. This stores the version number of that particular FE database.
On your Server, or NAS, place a copy of the FE. This will be the 'Master' copy and will be the one you modify.
I use a 'Splash' form for my applications which opens up, displaying the current Version number and which runs the version check, but you can implement how you want.
The code I use is:
Code:Dim strVerClient As String, strVerServer As String strVerClient = Nz(DLookup("[VersionNumber]", "[tbl_VersionClient]"), "") strVerServer = Nz(DLookup("[VersionNumber]", "[tbl_VersionServer]"), "") If strVerClient <> strVerServer Then 'This copy of the FE is out of date and we need to get the latest version Dim strSourceFile As String, strDestFile As String Dim strAccessExePath As String, lngResult As Long 'Create the source's path and file name. strSourceFile = "\\YourServerOrNasPath\FolderWhereMasterFEisKept\NameOfYourDatabase.mdb" strDestFile = CurrentProject.FullName 'Determine path of current Access executable strAccessExePath = SysCmd(acSysCmdAccessDir) & "MSAccess.exe " If Dir(strSourceFile) = "" Then 'Something is wrong and the file is not there. MsgBox ("Please see system administrator") Else 'copy the new version of app over the existing one. lngResult = apiCopyFile(strSourceFile, strDestFile, False) End If 'Modify strDestFile slightly so that it can be used with the Shell function strDestFile = """" & strDestFile & """" MsgBox "Application Updated. Please wait while the application restarts.", vbInformation, "Update Successful" 'Load new version, then close old one. Shell strAccessExePath & strDestFile & "", vbMaximizedFocus DoCmd.Quit End If
In a new Module, enter the following and save the Module (I call mine mod_UpdateApplication)
Code:Declare Function apiCopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long
So, to update everyone's FE, make your modifications to the Master FE, update the Version Number in both tbl_VersionServer and tbl_VersionClient and that's it.
One thing, make sure in your Master FE the Version Numbers are the same in both tables or your users get stuck in a loop!
You need to make sure the NAS can be accessed like a normal windows share (ie you can access via Windows Explorer and can map it as such). I bought a Zxyel 320, most of them do appear like a windows share, but make sure before you purchase it. Some have an application to access files on the NAS which is not what you want.
just standard SATA drives, although I'd stay away from Seagate drives right enough (And Samsung as its now Seagate that own Samsung's HDD division as far as I know)
WD are ok, but Ive always had problems with Seagate drives. Even when I worked for IBM, we would stay clear of seagate drives unless we couldnt get IBM, Maxtor or WD drives.
If your getting 2 x 2TB drives, remember to set it up as RAID1 on the NAS, that gives you fault tolerance to a certain degree, but whatever you do, dont use RAID0, RAID0 is a hell of a let faster seek and read times but if one of the drives fail, you lose the data on both the drives.
Yep that link to Dabs is the same one I got, not to shabby for that price I think you'll agree!
As for the drive, maybe this one would be a better choice, a few pound dearer but I think WD drives are most reliable than Seagate.
http://www.dabs.com/products/western-digital-2tb-green-sata-600-64mb-3-5--7G12.html?src=2
IBM drives are very hard to get, Im not sure they even still manufacture them. But to answer your question I'd have a WD before I'd buy a maxtor, Ive had some maxtors brand new with bad sectors, so I tend to avoid them as well.
no, wouldnt think so unless your fitting the gear in somewhere with a lot of RFI or EMI (radio freq interference or elecroto magnetic interference) like a hospital setting or such.