473,320 Members | 2,027 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,320 software developers and data experts.

Shell command and File Not Found

Im using the following code to open a second access database:

Dim stAppName As String
Dim retVal As Integer

stAppName = "msaccess.exe" & "C:\PlantManager\Plants.mdb"
retVal = Shell(stAppName, 1)

and access returns an error of File Not Found. I tried the following
variation with the same result:

Dim stAppName As String
stAppName = "msaccess.exe" & "C:\PlantManager\Plants.mdb"
Call Shell(stAppName, 1)

Dim stAppName As String
stAppName = "C:\Program Files\Microsoft Office\OFFICE11\msaccess.exe" &_
"C:\PlantManager\Plants.mdb"
Call Shell(stAppName, 1)

Dim stAppName As String
stAppName = "msaccess.exe" & Chr(34) & "C:\PlantManager\Plants.mdb" &
Chr(34)
Call Shell(stAppName, 1)

any thoughts
Feb 18 '07 #1
7 14631
On Feb 17, 7:58 pm, "Jimmy" <d...@email.mewrote:
Im using the following code to open a second access database:

Dim stAppName As String
Dim retVal As Integer

stAppName = "msaccess.exe" & "C:\PlantManager\Plants.mdb"
retVal = Shell(stAppName, 1)

and access returns an error of File Not Found. I tried the following
variation with the same result:

Dim stAppName As String
stAppName = "msaccess.exe" & "C:\PlantManager\Plants.mdb"
Call Shell(stAppName, 1)

Dim stAppName As String
stAppName = "C:\Program Files\Microsoft Office\OFFICE11\msaccess.exe" &_
"C:\PlantManager\Plants.mdb"
Call Shell(stAppName, 1)

Dim stAppName As String
stAppName = "msaccess.exe" & Chr(34) & "C:\PlantManager\Plants.mdb" &
Chr(34)
Call Shell(stAppName, 1)

any thoughts
Thought1:
Shell SysCmd(acSysCmdAccessDir) & "MsAccess.Exe " _
& """C:\Documents and Settings\Lyle Fairfield\My Documents\Access
\northwind.mdb"""

Thought2:
Dim a As Access.Application

Sub temp()
Set a = New Access.Application
With a
.OpenCurrentDatabase "C:\Documents and Settings\Lyle Fairfield\My
Documents\Access\northwind.mdb"
.Visible = True
End With
End Sub

Sub Later()
If Not a Is Nothing Then
a.Quit
Set a = Nothing
End If
End Sub

Thought3:
When you tell why sometimes there are better ways suggested.
Feb 18 '07 #2
On Feb 17, 7:58 pm, "Jimmy" <d...@email.mewrote:
Im using the following code to open a second access database:

Dim stAppName As String
Dim retVal As Integer

stAppName = "msaccess.exe" & "C:\PlantManager\Plants.mdb"
retVal = Shell(stAppName, 1)

and access returns an error of File Not Found. I tried the following
variation with the same result:

Dim stAppName As String
stAppName = "msaccess.exe" & "C:\PlantManager\Plants.mdb"
Call Shell(stAppName, 1)

Dim stAppName As String
stAppName = "C:\Program Files\Microsoft Office\OFFICE11\msaccess.exe" &_
"C:\PlantManager\Plants.mdb"
Call Shell(stAppName, 1)

Dim stAppName As String
stAppName = "msaccess.exe" & Chr(34) & "C:\PlantManager\Plants.mdb" &
Chr(34)
Call Shell(stAppName, 1)

any thoughts
http://www.m-w.com/dictionary/Isthisatrickquestion?

The word you've entered isn't in the dictionary. Click on a spelling
suggestion below or try again using the search bar above.

Suggestions for isthisatrickquestion?:
1. aesthetic distance
2. East Stroudsburg
3. aussitot dit, aussitot fait

..exe "

James A. Fortune
CD********@FortuneJames.com

Feb 18 '07 #3
Hi, Jimmy.
any thoughts
This line of code concatenates two strings together:

stAppName = "msaccess.exe" & "C:\PlantManager\Plants.mdb"

After it executes the stAppName variable contains
"msaccess.exeC:\PlantManager\Plants.mdb" -- so look at it a little closer,
and tell me why your operating system can't find a file on the
msaccess.exeC:\ drive.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blog: http://DataDevilDog.BlogSpot.com
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"Jimmy" <do**@email.mewrote in message
news:9x****************@fe01.news.easynews.com...
Im using the following code to open a second access database:

Dim stAppName As String
Dim retVal As Integer

stAppName = "msaccess.exe" & "C:\PlantManager\Plants.mdb"
retVal = Shell(stAppName, 1)

and access returns an error of File Not Found. I tried the following
variation with the same result:

Dim stAppName As String
stAppName = "msaccess.exe" & "C:\PlantManager\Plants.mdb"
Call Shell(stAppName, 1)

Dim stAppName As String
stAppName = "C:\Program Files\Microsoft Office\OFFICE11\msaccess.exe"
&_
"C:\PlantManager\Plants.mdb"
Call Shell(stAppName, 1)

Dim stAppName As String
stAppName = "msaccess.exe" & Chr(34) & "C:\PlantManager\Plants.mdb" &
Chr(34)
Call Shell(stAppName, 1)

any thoughts

Feb 18 '07 #4

"'69 Camaro" <Fo**************************@Spameater.orgZERO_SP AMwrote in
message news:12*************@corp.supernews.com...
This line of code concatenates two strings together:

stAppName = "msaccess.exe" & "C:\PlantManager\Plants.mdb"
stAppName = "msaccess.exe C:\PlantManager\Plants.mdb"

works like a charm!
Feb 18 '07 #5
What?

<CD********@FortuneJames.comwrote in message
news:11**********************@v33g2000cwv.googlegr oups.com...
On Feb 17, 7:58 pm, "Jimmy" <d...@email.mewrote:
>Im using the following code to open a second access database:

Dim stAppName As String
Dim retVal As Integer

stAppName = "msaccess.exe" & "C:\PlantManager\Plants.mdb"
retVal = Shell(stAppName, 1)

and access returns an error of File Not Found. I tried the following
variation with the same result:

Dim stAppName As String
stAppName = "msaccess.exe" & "C:\PlantManager\Plants.mdb"
Call Shell(stAppName, 1)

Dim stAppName As String
stAppName = "C:\Program Files\Microsoft Office\OFFICE11\msaccess.exe"
&_
"C:\PlantManager\Plants.mdb"
Call Shell(stAppName, 1)

Dim stAppName As String
stAppName = "msaccess.exe" & Chr(34) & "C:\PlantManager\Plants.mdb" &
Chr(34)
Call Shell(stAppName, 1)

any thoughts

http://www.m-w.com/dictionary/Isthisatrickquestion?

The word you've entered isn't in the dictionary. Click on a spelling
suggestion below or try again using the search bar above.

Suggestions for isthisatrickquestion?:
1. aesthetic distance
2. East Stroudsburg
3. aussitot dit, aussitot fait

.exe "

James A. Fortune
CD********@FortuneJames.com

Feb 18 '07 #6
Hi, Jimmy.
stAppName = "msaccess.exe C:\PlantManager\Plants.mdb"

works like a charm!
Good job!

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blog: http://DataDevilDog.BlogSpot.com
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"Jimmy" <do**@email.mewrote in message
news:ZP********************@fe08.news.easynews.com ...
>
"'69 Camaro" <Fo**************************@Spameater.orgZERO_SP AMwrote
in message news:12*************@corp.supernews.com...
>This line of code concatenates two strings together:

stAppName = "msaccess.exe" & "C:\PlantManager\Plants.mdb"

stAppName = "msaccess.exe C:\PlantManager\Plants.mdb"

works like a charm!

Feb 18 '07 #7
On Feb 18, 1:24 pm, "Jimmy" <d...@email.mewrote:
What?
Exactly. The point was to show you, from Access' perspective, what
you did. Access was forced to say, "What?" because of the missing
space. If you have a space in the path be sure to find a way to
include double quotes as shown by Lyle or your example containing
Chr(34). Explaining it detracts from the total effect though.

James A. Fortune
CD********@FortuneJames.com

Feb 19 '07 #8

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...
4
by: Yann.K | last post by:
Hello. Using Tkinter, i would create a widget which display a shell command return. This return is long, and i would display a real time display (like with the tail -f commande on Linux) I...
10
by: Siemel Naran | last post by:
Hi. I'm writing a command shell that reads commands from standard input. At this point I have the command in a std::string. Now I want to execute this command in the shell. From the Borland...
8
by: zhiwei wang | last post by:
I remember that there is a function that could invoke shell command such as "rm" "cp", directly in .c file. But I could not recall its name, and I googled with nothing meaningful. I vaguely...
9
by: Tommy Lu | last post by:
Hi, wondering if there is a way to interact the shell command with the C# program? For example, if I type c:\>ver it then suppose to return the version of the OS I am currently using... or ...
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...
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: RLN | last post by:
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...
10
by: Justin | last post by:
We have a simple shell script called testsp.sh (located at /home/ userid) Within the shell script, the following command is called: db2 -tvf callsp.sql When the shell script is run in command...
3
by: davidholmes | last post by:
I need to load a csv file into excel with the shell command. My code works fine as long as excel is not already running but if there is another instance of excel open the shell command opens a new...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.