Sign in to follow this  
Followers 0
maxd

how to run m$ access base (*.mdb file)

8 posts in this topic

i try :

$ms = "C:\Program Files\Microsoft Office\Office10\msaccess.exe"
Run("$ms C:\base.mdb")

.. and not work :P

Share this post


Link to post
Share on other sites



i try :

$ms = "C:\Program Files\Microsoft Office\Office10\msaccess.exe"
Run("$ms C:\base.mdb")

.. and not work :P

Try

Run($ms & "c:\base.mdb")


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Try

Run($ms & "c:\base.mdb")
Error: Unable to execute the external program :lmao:

but if create "runmdb.bat" file:

c:\base.mdb

and script

Run("c:\runmdb.bat")

works :P

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Error: Unable to execute the external program :lmao:

but if create "runmdb.bat" file:

c:\base.mdb

and script

Run("c:\runmdb.bat")

works :P

Try

$ms = FileGetShortName("C:\Program Files\Microsoft Office\Office10\msaccess.exe")
Run($ms & "C:\base.mdb")
Edited by BigDod


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Try this:

$path = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Access\InstallRoot", "Path") & "msaccess.exe "
$mdb = "C:\Test.mdb"
Run($path & $mdb)

You will have to adjust the number in the code above (i.e. 11.0) to reflect the version of office you have installed.

Office 2000 = 9.0

Office XP 2002 = 10.0

Office 2003 = 11.0

but I think the problem with your code was that there was no space between the command line and database path.

Run($ms & "c:\base.mdb")

Would return "C:\Program Files\Microsoft Office\Office10\msaccess.exec:\base.mdb"

There has to be a space between msaccess.exe and c:\base.mdb

Run($ms & " " & "c:\base.mdb")[code=auto:0]

Should fix your problem


We have enough youth. How about a fountain of SMART?

Share this post


Link to post
Share on other sites

Run($ms & " " & "c:\base.mdb")

Should fix your problem

Yeah, or just put a space between " and c...

Run($ms & " c:\base.mdb")

My UDFs: ExitCodes

Share this post


Link to post
Share on other sites

I have a similar issue except I need to run various files. Is there no way to run a file so that windows chooses the appropriate application to open it in? Like if I wanted to run a *.lnk or *.jpg or *.doc file.

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
Sign in to follow this  
Followers 0