I have two VBScripts (one installs a shortcut for a Db and the other opens it). When I click on the shortcut that my installer script created, the database will open but then immediately close. Can anyone help me figure out what I am doing wrong?
Installer script
Opener script
Any assistance would be greatly appreciated.
Travis
"Why would I ever want to learn about programming when Micorsoft products would be able to handle even the simplest of tasks. Oh...wait a minute...something's wrong with that statement!
Installer script
Code:
Dim oShell
Dim sDesk
Dim oShortCut
Dim strFileName
Set oShell = CreateObject("WScript.Shell")
sDesk = oShell.SpecialFolders.Item("Desktop")
Set oShortCut = oShell.CreateShortcut(sDesk & "\Bowen Db.lnk")
With oShortCut
.TargetPath = "C:\Program Files\Bowen Db Opener.vbs"
.Description = "Bowen Db"
.WorkingDirectory = "C:\Program Files\Bowen Db Opener.vbs"
.Save
End With
MsgBox "Installation Complete!"
Opener script
Code:
Dim lfsobject
Dim dbsLTTFront
On Error Resume Next
Set lfsObject = CreateObject("Scripting.FileSystemObject")
lfsObject.CopyFile "************************\Bowen Db.mdb", "C:\Program Files\Bowen Db.mdb"
If Err.Number = 0 Then
Set dbsLTTFront = CreateObject("Access.Application")
'dbsLTTFront.AutomationSecurity = 1 'msoAutomationSecurityLow
dbsLTTFront.Visible = True
dbsLTTFront.OpenCurrentDatabase "C:\Program Files\Bowen Db.mdb"
Else
'Err number 70, 7866 and -2147023170 sometimes occur with rampant clicking
Msgbox ("The application takes a moment to load, please be patient.")
End If
Any assistance would be greatly appreciated.
Travis
"Why would I ever want to learn about programming when Micorsoft products would be able to handle even the simplest of tasks. Oh...wait a minute...something's wrong with that statement!