Using 2003 installer to create setup that runs code from users shortcut.

N

Nick Smith

Hi
I am wanting to build a setup routine with Access 2003 packaging wizzard that will run a piece of code from the users shortcut. Is there any way to do this? My intention in doing this is to overcome the warning messages I am getting when installing Access 2003 on machines that don't have Access installed by setting the security level to low before my app. runs. The code I want to run is as follows:
Const cDatabaseToOpen = "C:\<FileToOpen>.mdb"

On Error Resume Next

Dim AcApp as ?

Set AcApp = CreateObject("Access.Application.11")

If AcApp.Version >= 11 Then

AcApp.AutomationSecurity = 1 ' msoAutomationSecurityLow

End If

AcApp.Visible = True

AcApp.OpenCurrentDatabase cDatabaseToOpen

If AcApp.CurrentProject.FullName <> "" Then

AcApp.UserControl = True

Else

AcApp.Quit

MsgBox "Failed to open '" & cDatabaseToOpen & "'."

End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top