• MS SQL Server: run external program

    From Erland Sommarskog@21:1/5 to J.O. Aho on Fri Jul 30 10:24:27 2021
    XPost: comp.databases.ms-access

    J.O. Aho (user@example.net) writes:
    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

    In *your* PATH variable. SQL Server runs under a service account, so
    it does not have your PATH.

    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

    So when you run that command line directly, what happens? Specifically,
    does it open a UI?

    SQL Server runs as a service and does not have a desktop, so running
    anything which has a UI is not going to work out.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ammammata@21:1/5 to All on Fri Jul 30 08:42:13 2021
    Il giorno Fri 30 Jul 2021 10:24:27a, *Erland Sommarskog* ha inviato su comp.databases.ms-access il messaggio
    news:XnsAD7769DEE4408Yazorman@127.0.0.1. Vediamo cosa ha scritto:

    Hello Erland

    So when you run that command line directly, what happens? Specifically,
    does it open a UI?


    yes: access loads the procedure and shows the record as per the ID I passed
    in the command line

    SQL Server runs as a service and does not have a desktop, so running
    anything which has a UI is not going to work out.



    Ok, I take a note. As I can run this command from a proper menu in SAP B1, unfortunately I can't pass a parameter as I would, I thought the same
    result could be achieved also from a SQL statement

    https://i.imgur.com/bKICPOv.png

    Our support just sent a mail saying we have to develop an Add-On, so now we wait for a quote (time & bucks)

    Bye

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)