-
i am trying to open a access db manually from vb
here is what i use
Code:
Accesspath = "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE"
toShutTheFunctionUP = ShellExecute(Me.hwnd, "open", Accesspath, "Z:\My Directory\MyDB.mdb", "", SW_SHOWNORMAL)
access cannot open because it says that
it cannot open "z:\my.mdb"
what it basically does is, looks for the first space in the string then treats that as the db name of db
and ignores anything after that
how can i send a string with directory path that contains spaces?
please and thank you
-
You can use the ShortPath function:
It return the shortpath(like in dos->8.3)
-
no shortpath ()
there is no function of such
there is a property of a file that is shortpath but not a function...
still stuck
-
Just do
toShutTheFunctionUP = ShellExecute(Me.hwnd, "open", "Z:\My Directory\MyDB.mdb", "", "", SW_SHOWNORMAL)
-
isn't that samething as my original post or i am just going blind? :)
-
I also hate to wear my glasses:
Yours: toShutTheFunctionUP = ShellExecute(Me.hwnd, "open", Accesspath, "Z:\My Directory\MyDB.mdb", "", SW_SHOWNORMAL)
Mine: toShutTheFunctionUP = ShellExecute Me.hwnd, "open", "Z:\My Directory\MyDB.mdb", "", "", SW_SHOWNORMAL)
-