Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MS SQL Server: run external program

57 views
Skip to first unread message

Ammammata

unread,
Jul 29, 2021, 6:43:23 AM7/29/21
to
Hi

I'm trying to run MS Access runtime, with my procedure and an additional
parameter

the command line is
MSACCESS.EXE c:\Sviluppo\QCT\QCT1000.mdb ;255

without path, being it already included in the PATH variable

this command works fine when I use the "Run" window




when I try this command from within MSSMS

EXEC xp_cmdshell 'MSACCESS.EXE c:\Sviluppo\QCT\QCT1000.mdb ;255';
GO

I get the error:

output
'MSACCESS.EXE' is not recognized as an internal or external command,
operable program or batch file.
NULL


If I include the path in the command line

EXEC xp_cmdshell '"C:\Program Files\Microsoft Office\Office16\MSACCESS.EXE"
c:\Sviluppo\QCT\QCT1000.mdb ;255';
GO

it goes into a loop and I have to kill MSSMS to exit

Note that I'm not sure how to use "" because of the space in the path
between words Microsoft and Office

Any suggestion is welcome



--
/-\ /\/\ /\/\ /-\ /\/\ /\/\ /-\ T /-\
-=- -=- -=- -=- -=- -=- -=- -=- - -=-
........... [ al lavoro ] ...........

J.O. Aho

unread,
Jul 29, 2021, 8:26:37 AM7/29/21
to

On 29/07/2021 12.43, Ammammata wrote:

Hi there,
this is a MySQL forum and has nothing to do with mssql or ms-access, so
adding c.d.ms-sqlserver and c.d.ms-access which also been follow-up to.


> I'm trying to run MS Access runtime, with my procedure and an additional
> parameter
>
> the command line is
> MSACCESS.EXE c:\Sviluppo\QCT\QCT1000.mdb ;255
>
> without path, being it already included in the PATH variable

Maybe that is your account users PATH and not the system PATH. There is
a creepy GUI that you can use and check that.


> when I try this command from within MSSMS
>
> EXEC xp_cmdshell 'MSACCESS.EXE c:\Sviluppo\QCT\QCT1000.mdb ;255';
> GO
>
> I get the error:
>
> output
> 'MSACCESS.EXE' is not recognized as an internal or external command,
> operable program or batch file.
> NULL

You need to give the full path to the MSACCESS.EXE or see to that the
service user that runs the mssql has the correct path set in PATH. Don't
forget to restart the service after change in the environment variables.

>
> If I include the path in the command line
>
> EXEC xp_cmdshell '"C:\Program Files\Microsoft Office\Office16\MSACCESS.EXE"
> c:\Sviluppo\QCT\QCT1000.mdb ;255';
> GO
>
> it goes into a loop and I have to kill MSSMS to exit
>
> Note that I'm not sure how to use "" because of the space in the path
> between words Microsoft and Office

Looks ok, as microsoft made a bad choise to use \ as directory divider
instead of /, so they couldn't escape characters as in most other
operating systems with the backslash.


> Any suggestion is welcome

Switch to a proper OS and a better database

--

//Aho
0 new messages