Solved

# Shell execute API vb.net Launch a program

Posted on 2013-10-25
Medium Priority
603 Views
Does an anyone know if it is possible to run an Access database without specifying the location of MCAccess.exe if so what is the syntax?

(My users have MSAccess.exe in various places) I thought of putting the location of the exe in a text file on the client but this is a bit clumsy.
0
Question by:HKFuey
• 2

LVL 23

Assisted Solution

CompProbSolv earned 600 total points
ID: 39601159
This should point you in the right direction:
http://support.microsoft.com/kb/317113

Dim oAccess As Access.Application

' Start a new instance of Access for Automation:
oAccess = New Access.ApplicationClass()

' Open a database in exclusive mode:
oAccess.OpenCurrentDatabase(filepath:="c:\mydb.mdb", Exclusive:=True)
0

LVL 75

Accepted Solution

käµfm³d   👽 earned 1400 total points
ID: 39601170
If the user has the corresponding Access database files registered to open with Access (by default they would), then you can simply specify the database filename to Process.Start. If the user has changed the default application for such files, then they will opened using that program.

e.g.

System.Diagnostics.Process.Start("C:\path\to\database\file.accdb")

0

Author Comment

ID: 39601249
Thanks, will try after the weekend! ; )
0

Author Closing Comment

ID: 39605573
Works great, thanks!
0

## Featured Post

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.