WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Access

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Office 2003 Macro Security Issue


Much publicized, but a real annoyance to programmers and legacy databases. Both Access and Excel, if not set to the lowest security level will pop-up messages about security when trying to load earlier versions of those products [I got called about an Access97 MDB, and updating to the Jet 8 patch].

Admins and small-business owners, overwhelmed with viruses and MS security patches are often reluctant to set security low or off.

The attached addresses that issue with an Access.Application Object - I'll have more in a bit about any problems with ADO and the Jet Provider; and Excel is a whole different can of worms. stan

; Office 2000
; overriding Security to load earlier versions
;
;/////////////////////////////////////////////////
cMDB = "C:\test\mdb97.mdb"
If ! FileExist(cMDB) Then Exit

oAcc = CreateObject("Access.Application")
If oAcc.Version >= 10 Then oAcc.AutomationSecurity = 1 ;msoAutomationSecurityLow
oAcc.Visible = @True
oAcc.OpenCurrentDatabase(cMDB) 
If oAcc.CurrentProject.FullName <> ""  
     oACc.UserControl = @True
Else
     oAcc.Quit()
     Message("Database Open Failed",cMDB)
EndIf

oAcc=0

Article ID:   W16598
File Created: 2005:02:18:12:21:34
Last Updated: 2005:02:18:12:21:34