executing a file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to execute a perl script from one of the switchboard selections.
Does anyone know how to do that?
Thanks.
 
Thanks, I tried the shell command attached to a click on a button. I get no
errors and I see a very quick flash of what appears to be a DOS command
window but it is gone before any contents can be seen. The perl file called
doesn't execute. Any further suggestions?
 
Exactly what are you passing as the argument to the Shell command? While you
may be able to simply type "file.pl" in a command prompt and have it run, I
believe you need to pass "perl.exe file.pl" to Shell.

In fact, you may need the full path fo perl.exe (and, of course, to the perl
file being run). If there are spaces in the paths, you'll need extra quotes:

"""C:\Program Files\Perl\Perl.exe"" ""C:\Some Folder\file.pl"""

(That's three double quotes at the beginning and end of the string, and a
couple of pairs of double quotes, with a space between the pairs, in the
middle)
 
My command looked like:
stAppName = "C:\Perl\bin\perl.exe C:\Documents and
Settings\myname\mydir\myfile.pl"
I had tried the double quotes but missed the triples which was giving a
syntax error. My command now has quotes as per your example. However, the
results are the same. I see the DOS command window flash and disappear. The
perl script has not executed.
Any other ideas?
Thank you.
 
How are you calling the Shell function? Are you passing a second parameter
as the WindowStyle?
 
I am using
Call Shell(stAppName, 1)
--
Linda


Douglas J. Steele said:
How are you calling the Shell function? Are you passing a second parameter
as the WindowStyle?
 
That's what I would have used.

I take it it works correctly if you open a Command prompt and type that same
information into it?
 
That's exactly what I've been trying since your last response. As it turns
out, I'm getting an error. I had gotten the perl script working standalone
before I tried to call it from the database. The perl script searches files
in a directory and determines which ones have been imported into the database
and then imports any that have not. The error I'm now getting is "The
database has been placed in a state by an unknown user that prevents it from
being opened or locked." Apparently I have some sharing issues between
Access and ODBC. Do you know anything about that?
Thank you so much for all your help. Your ideas have helped me move forward.
 
Afraid I don't know enough about Perl to be able to help.

You could try posting in microsoft.public.access.externaldata: John Nurick
tends to hang around there, and is good with Perl.
 
Again, thanks for all your help.
--
Linda


Douglas J. Steele said:
Afraid I don't know enough about Perl to be able to help.

You could try posting in microsoft.public.access.externaldata: John Nurick
tends to hang around there, and is good with Perl.
 
Back
Top