Open access database from vb exe file

J

JCP

In my computer I have installed access 2003 and access 2007
I’m creating an exe file in vb to open an access database build in access
2003 to hide security warning

I’m using the following code

Private Sub Form_Load()
Dim MyAccess As Object
Dim dbPathName As String

dbPathName = "C:\Program Files\JLP\DB_Works\Works.mde"
Set MyAccess = CreateObject("Access.Application.11")
MyAccess.AutomationSecurity = 1 'set macro security LOW.
MyAccess.OpenCurrentDatabase (dbPathName)
MyAccess.UserControl = True
MyAccess.Visible = Visible
Set MyAccess = Nothing

Unload Me
End Sub

When I open the exe file, it open the Access database in the current Access
version. I mean, if from windows start button I open access 2003 and then a
click in the exe file, my access database open in access 2003 version. I
closed all and then from windows start button I open access 2007 and then I
open exe file my access database open in 2007 version.

Question:
What can I add to vb script to open my access database in access 2003
version, hide security warning and co-exist with all other versions of
Access?

jcp
 

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