Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need VBS file help

Status
Not open for further replies.

GingerR

MIS
Apr 17, 2001
3,134
US
Hi. I launch vbs files from Windows Scheduler to open/run MS Access db's (2003) at various times during the night. In the VBS files, I set the security of the db to low so they'll open and run.

One problem I now have is that db's with MS Access security--I need to know the syntax to make them open using the mdw files so they'll run, otherwise there's not the right permissions. Here's the current code:
Code:
Const cDatabaseToOpen = "\\evt02dat\esubavionics\computing\lod\system\csos.mdb"
 
On Error Resume Next
Dim AcApp 
Set AcApp = CreateObject("Access.Application")
If Val(AcApp.Version) >= 11  Then
    AcApp.AutomationSecurity = 1 ' msoAutomationSecurityLow
End If
AcApp.Visible = True
AcApp.OpenCurrentDatabase cDatabaseToOpen

I need to add
workgroup: \\evt02dat\esubavionics\computing\lod\system\system.mdw

Admin ID: /User "SysAdmin" (do I need to add this?)

I've tried changing the Const cDatabaseToOpen path in various ways but it won't work.

Thanks-g

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Hi,

Just in case you don't get an answer, I believe that the 'level' of security is checked against the 'user' that attempts to run the application.

Therefore, if the network login (sysadmin?) runs the application via a script - via Scheduler, then this 'user' will have security priveleges to run it.

Have you added the network 'sysadmin' to the application .mdw as a user with full rights?

ATB

Darrylle

Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
How about:

Code:
AcApp.DBEngine.SystemDB = "C:\Docs\Tek.mdw"
Set ws = AcApp.DBEngine.CreateWorkspace("wsWS", "admin", "", 2)

Set db = ws.OpenDatabase("C:\Docs\Tek-Tips.mdb")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top