I have a small database that needs to open another database with workgroup settings on. The directory and filename of this database is stored in a table which I then get variables from to use in the Shell command line as follows:
sAccess = rsFileInfo("AccessPath")
sFISPath = """" & rsFileInfo("FISPath")
sFISName = rsFileInfo("FISName") & """"
sSwitches = " /wrkgrp " & rsFileInfo("FISPath") & "dbworkgroup.mdw /user dbadmin /pwd owner"
Retval = Shell(sAccess & " " & sFISPath & sFISName & sSwitches, vbMinimizedNoFocus)
This all works fine when the directory has no spaces in it, however I need it to open a database that is in a directory path with spaces in. When I try to run the above code for directory C:\Test 1\ instead of C:\Test\ I get the error "The command line you used to start Microsoft Access contains an option that Microsoft Access doesn't recognise". If I close this another error appears saying "Microsoft Access cannot find file 'C:\Test'. This file is required for start up.
Does anyone know how to run the Shell command for a path with spaces in, or an alternative command?
sAccess = rsFileInfo("AccessPath")
sFISPath = """" & rsFileInfo("FISPath")
sFISName = rsFileInfo("FISName") & """"
sSwitches = " /wrkgrp " & rsFileInfo("FISPath") & "dbworkgroup.mdw /user dbadmin /pwd owner"
Retval = Shell(sAccess & " " & sFISPath & sFISName & sSwitches, vbMinimizedNoFocus)
This all works fine when the directory has no spaces in it, however I need it to open a database that is in a directory path with spaces in. When I try to run the above code for directory C:\Test 1\ instead of C:\Test\ I get the error "The command line you used to start Microsoft Access contains an option that Microsoft Access doesn't recognise". If I close this another error appears saying "Microsoft Access cannot find file 'C:\Test'. This file is required for start up.
Does anyone know how to run the Shell command for a path with spaces in, or an alternative command?