473,395 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Shell command won't work using file server path

RLN
Re: Access 2003/WinXP Pro-SP3

I have a shell command that does not run correctly.

I have two programs located on a file server: Pgm1.mdb and Pgm2.mdb

Pgm1 launches Pgm2 via a command button using a shell command.
The old method ran fine when the specified file server was mapped on
the user's workstation as a drive letter (U)
strAppName = "msaccess.exe " & "U:\Access_EQ\EQ-NonCorp.MDB"
Call Shell(strAppName, 1)

However, hard coding the drive letter in the path is not wise, so I
wanted to specifiy the server this way by its full path:
\\kcnccp50y\Financial Accounting Restricted\Access_EQ\NonCorp\
(Pgm1.mdb uses this path very nicely when importing excel file from
this server, etc.)

When Pgm1 calls Pgm2 (they are in the same folder on the file server)
this does not work:
stAppName = "msaccess.exe " & "\\kcnccp50y\Financial Accounting
Restricted\Access_EQ\NonCorp\EQ-NonCorp.MDB".
Call Shell(strAppName, 1)

The error received is:
"The command line you used to start Microsoft Access contains an option
that Microsoft Access doesn't recognize."

Is there a work around for this so I can call another program using the
actual file server share name in lieu of a drive letter (which may or
may not be mapped correctly on every user's workstation?)

Thanks,
RLN

May 18 '06 #1
4 8023

"RLN" <rl***************@yahoo.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
Re: Access 2003/WinXP Pro-SP3

I have a shell command that does not run correctly.

I have two programs located on a file server: Pgm1.mdb and Pgm2.mdb

Pgm1 launches Pgm2 via a command button using a shell command.
The old method ran fine when the specified file server was mapped on
the user's workstation as a drive letter (U)
strAppName = "msaccess.exe " & "U:\Access_EQ\EQ-NonCorp.MDB"
Call Shell(strAppName, 1)

However, hard coding the drive letter in the path is not wise, so I
wanted to specifiy the server this way by its full path:
\\kcnccp50y\Financial Accounting Restricted\Access_EQ\NonCorp\
(Pgm1.mdb uses this path very nicely when importing excel file from
this server, etc.)

When Pgm1 calls Pgm2 (they are in the same folder on the file server)
this does not work:
stAppName = "msaccess.exe " & "\\kcnccp50y\Financial Accounting
Restricted\Access_EQ\NonCorp\EQ-NonCorp.MDB".
Call Shell(strAppName, 1)

The error received is:
"The command line you used to start Microsoft Access contains an option
that Microsoft Access doesn't recognize."

Is there a work around for this so I can call another program using the
actual file server share name in lieu of a drive letter (which may or
may not be mapped correctly on every user's workstation?)

Thanks,
RLN


Try adding double quotes around your path so the shell command receives the
path with quotes

stAppName = "msaccess.exe " & """\\kcnccp50y\Financial Accounting
Restricted\Access_EQ\NonCorp\EQ-NonCorp.MDB""".
May 18 '06 #2
RLN
Try adding double quotes around your path so the shell command receives the
path with quotes


Global Const gblPgmPath = ""\\kcnccp50y\Financial Accounting
Restricted\Access_EQ\Corp\""
Actually, I have it declared like you see above, but I want to use it
in a variable, 'gblPgmPath' then reference it in various locations in
the application (in Shell statements and other code) like:
stAppName = "msaccess.exe " & gblPgmPath
The problem here is when I compile, I get an error "Expected
Expression" & the compiler highlights the 2nd forward slash in the
"global const" line of code as I have referenced above.

Due to this error, am I stuck hard coding it in my application like
this:
stAppName = "msaccess.exe " & """\\kcnccp50y\Financial Accounting
Restricted\Access_EQ\NonCorp\EQ-NonCorp.MDB"""

Thanks.

May 19 '06 #3
Was this a type for your message? In one place it is:

Global Const gblPgmPath = ""\\kcnccp50y\Financial Accounting
Restricted\Access_EQ\Corp\""
but then later you say it is:

"""\\kcnccp50y\Financial Accounting
Restricted\Access_EQ\NonCorp\EQ-NonCorp.MDB"""

In one place it is \Corp\ in the other place it is \NonCorp\
In one place you include the mdb name in the other palce you do
not..

stAppName = "msaccess.exe " & gblPgmPath
(without mdb name)

and then:
stAppName = "msaccess.exe " & """\\kcnccp50y\Financial Accounting
Restricted\Access_EQ\NonCorp\EQ-NonCorp.MDB"""

May 22 '06 #4
RLN

stAppName = "msaccess.exe " & """\\kcnccp50y\Financial Accounting
Restricted\Access_EQ\NonCorp\EQ-NonCorp.MDB"""

this worked! Thank you.
Ron2006 wrote:
Was this a type for your message? In one place it is:

Global Const gblPgmPath = ""\\kcnccp50y\Financial Accounting
Restricted\Access_EQ\Corp\""
but then later you say it is:

"""\\kcnccp50y\Financial Accounting
Restricted\Access_EQ\NonCorp\EQ-NonCorp.MDB"""

In one place it is \Corp\ in the other place it is \NonCorp\
In one place you include the mdb name in the other palce you do
not..

stAppName = "msaccess.exe " & gblPgmPath
(without mdb name)

and then:
stAppName = "msaccess.exe " & """\\kcnccp50y\Financial Accounting
Restricted\Access_EQ\NonCorp\EQ-NonCorp.MDB"""


May 23 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joe Blo | last post by:
I have this line in my code that spits out (run time error 53, file not found). Running this program (project.exe) works fine if I do it through the command prompt or Run dialogue box on the...
6
by: Hal Vaughan | last post by:
I have a script used to find and run Java on a Windows system.  It worked fine on original tests (on a Windows XP system).  It's now running on a Windows 2000 (sp3) system, and it won't work -- the...
2
by: Fred Snider | last post by:
Help! Opening a new window using the window.open( ) command works great for opening new windows and having them on top and having the focus. The window.focus command brings any existing...
2
by: jcrouse | last post by:
I apologize for starting another thread but the old one had a weird subject line. Anyways...here is the code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As...
3
by: musosdev | last post by:
Hi guys Okay, I've setup my projects to open and compile fine in VS2005 using FPSE and remote web, but it's *really* slow. So I thought I'd have a go at doing it the normal way, by loading from...
6
by: Hugh Janus | last post by:
Hi group, I am executing a shell command that calls a .BAT file. I have to wait for this batch file to finish so I use the wait = true parameter in the shell command. However, this means that...
2
by: ¹é¿ø¼® | last post by:
Hello, everybody. I want to call any shell command from php script using shell_exec(). The problem is that the next line of the php script would not be run until a few minutes after running the...
4
by: G. Miller | last post by:
Hey, I'm trying to automate an import routine by using the shell command to call a batch file that will run a vendor export utility before continuing with the import. The problem is that...
34
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.