AcApp.CurrentProject.FullName Empty
- From: "Brad Baker" <brad@xxxxxxxxxxxxx>
- Date: Wed, 5 Nov 2008 15:36:15 -0500
I am calling the script below as follows:
wscript runmacro.vbs database_name.mdb macro_to_run
This has been working fine for over a year and now suddenly its stopped working. When I run the command I get the following wscript prompt:
Failed to open C:\company\datafeeds\database_name.mdb
I can only assume thats because AcApp.CurrentProject.FullName is empty but I can't figure out why. The pathing information all looks fine, the access db isn't being held open by any locks, the user I am running the script under has proper permissions.
Does anyone have any ideas?
Thanks
Brad
The contents of runmacro.vbs:
============================
Dim DBName, MacroName
DBName = "C:\company\datafeeds\" & WScript.Arguments(0)
MacroName = WScript.Arguments(1)
On Error Resume Next
Dim AcApp
Set AcApp = CreateObject("Access.Application")
If Val(AcApp.Version) >= 11 Then
'Turn off Warnings so the macros can run correctly.
AcApp.AutomationSecurity = 1
AcApp.SetOption "Confirm Action Queries", 0
AcApp.SetOption "Confirm Document Deletions", 0
AcApp.SetOption "Confirm Record Changes", 0
End If
AcApp.Visible = True
AcApp.OpenCurrentDatabase DBName
If AcApp.CurrentProject.FullName <> "" Then
AcApp.UserControl = True
Else
AcApp.Quit
MsgBox "Failed to open '" & DBName & "'."
End If
AcApp.DoCmd.RunMacro MacroName
acApp.CloseCurrentDatabase
AcApp.Close
AcApp.Quit
Set appAcc = Nothing
.
- Follow-Ups:
- Re: AcApp.CurrentProject.FullName Empty
- From: Joe Fawcett
- Re: AcApp.CurrentProject.FullName Empty
- Prev by Date: Re: Script to add computer in Active Directory to all users in an OU
- Next by Date: Get info from another script file; pass an array?
- Previous by thread: Re: Script to query user information based upon group membership
- Next by thread: Re: AcApp.CurrentProject.FullName Empty
- Index(es):
Relevant Pages
|