I have the below script which I have inherited, but know nothing about vbscripting! all it does is copies a server version of a db to the client machine.
The code is activated via another db so when that application has quit and inbetween copying the server db and opening it, the machine looks like it is not doing anything. I wanted to somehow display some sort of messages of the progress and an hourglass. etc.
Can someone please help on how to edit this code and what to do.
Cheers
neemi
The code is activated via another db so when that application has quit and inbetween copying the server db and opening it, the machine looks like it is not doing anything. I wanted to somehow display some sort of messages of the progress and an hourglass. etc.
Can someone please help on how to edit this code and what to do.
Code:
If WScript.Arguments.Count = 4 Then
sCentralCopy = Wscript.Arguments.Item(0)
sLocalFolder = Wscript.Arguments.Item(1)
sAppName = Wscript.Arguments.Item(2)
sAppVersion = Wscript.Arguments.Item(3)
Else
MsgBox "Incorrect number of Arguments - Upgrade failed"
WScript.QUIT(0)
End If
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(sCentralCopy & sAppName & ".mdb") Then
objFSO.CopyFile sCentralCopy & sAppName & ".mdb", sLocalFolder, True
Call OpenAccess
Else
Wscript.Echo "Central copy file does not exist."
WScript.QUIT(0)
End If
Function OpenAccess()
Select Case sAppVersion
Case 9
Set AcApp = CreateObject("Access.Application.9")
Case 10
Set AcApp = CreateObject("Access.Application.10")
Case 11
Set AcApp = CreateObject("Access.Application.11")
Case 12
Set AcApp = CreateObject("Access.Application.12")
End Select
AcApp.AutomationSecurity = 1
AcApp.Visible = True
AcApp.OpenCurrentDatabase sLocalFolder & "\" & sAppName & ".mdb"
AcApp.UserControl = True
Set AcApp = Nothing
End Function
Cheers
neemi