Joe4

Open an Access Database

5 posts in this topic

I am creating a script that copies over the most recent version of a Front-End Access database to a user's hard-drive, and then opens it.  I have researched and seen lots of topics on connecting to an Access database, but I am not trying to do that.  I am simply trying to open it for them.

In a DOS batch file, the file to do that would look something like this:

"C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE" "C:\Databases\MyDatabase.accdb"

So, what is the equivalent statement I would use in an AutoIt script to open the Access database?

Thanks

Share this post


Link to post
Share on other sites



Please clarify: Are you trying to launch MSAccess on the user's workstation or are you trying to access / read from the database directly from your script?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi, Joe4, welcome to the forum. Look at Run in the help file, the syntax would be almost identical.

Edit -  Or, look at ShellExecute: 

ShellExecute("C:\Databases\MyDatabase.accdb")

 

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

If you just want to launch Access similar to the batch file, then you should take a look at the Run and ShellExecute commands in the help file.

Share this post


Link to post
Share on other sites

Thank you!

ShellExecute did the trick!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now