ldub Posted October 13, 2008 Share Posted October 13, 2008 (edited) I run without problem a MS Access application like this : ; $param is the mdb file to be loaded $param = "D:\ACCESS\Test.mdb" ShellExecute("MSACCESS.EXE", $param) But, if my path (in $param) contains spaces, it doesn't word : $param = "D:\ACCESS - PRG\Test.mdb" ShellExecute("MSACCESS.EXE", $param) Why ? How can I do ? This problem doesn't occurs with Notepad... Thanks for your help. Edited October 14, 2008 by ldub Link to comment Share on other sites More sharing options...
Andreik Posted October 13, 2008 Share Posted October 13, 2008 I run without problem a MS Access application like this : ; $param is the mdb file to be loaded $param = "D:\ACCESS\Test.mdb" ShellExecute("MSACCESS.EXE", $param) But, if my path (in $param) contains spaces, it doesn't word : $param = "D:\ACCESS - PRG\Test.mdb" ShellExecute("MSACCESS.EXE", $param) Why ? How can I do ? This problem doesn't occurs with Notepad... Thanks for your help.Try full path for MSAcces.exe or I think is enough ShellExecute("D:\ACCESS\Test.mdb") When the words fail... music speaks. Link to comment Share on other sites More sharing options...
ldub Posted October 13, 2008 Author Share Posted October 13, 2008 (edited) Try full path for MSAcces.exe or I think is enough ShellExecute("D:\ACCESS\Test.mdb") Thanks for your help but I get always the same error. In fact, my exact command line is : $param = "D:\ACCESS - PRG ACTIFS\TestExtractPhotos.mdb /CMD" & '"' & @WorkingDir & '"' ShellExecute("C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE", $param) The problem occurs when MSAccess is loaded, it tells me "bad options" and "D:\ACCESS.mdb doesn't exist" The problem exists ONLY if my path contains spaces. Edited October 13, 2008 by ldub Link to comment Share on other sites More sharing options...
ldub Posted October 14, 2008 Author Share Posted October 14, 2008 (edited) Thanks for your help but I get always the same error.In fact, my exact command line is :$param = "D:\ACCESS - PRG ACTIFS\TestExtractPhotos.mdb /CMD" & '"' & @WorkingDir & '"'ShellExecute("C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE", $param)The problem occurs when MSAccess is loaded, it tells me "bad options" and "D:\ACCESS.mdb doesn't exist"The problem exists ONLY if my path contains spaces.************************************************************************************************************************Finally, I found by myself the solution on the forum of VbScript (they have the same problems whith path containing spaces).$Myparam1 = "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE "$MyParam2 = 'D:\ACCESS - PRG ACTIFS\TestExtractPhotos.mdb'$MyParam3 = ' /CMD' & '"' & @WorkingDir & '"'ShellExecute($MyParam1, Chr(34) & $MyParam2 & Chr(34) & $MyParam3)************************************************************************************************************************** Edited October 14, 2008 by ldub Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now