1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

OdbcException with PsExec on remote machine using OpenEdge driver for Progress

Discussão em 'StackOverflow' iniciado por fdantas, Março 7, 2018.

  1. fdantas

    fdantas Administrator Moderador

    I have a remote machine (let's call it Target) on which the driver OpenEdge 10.1B is installed (communication with Progress database).

    I have an exe on this remote machine that connects to the Progress database through the driver. When i log onto this machine (rdp) with my windows account then I test this executable file, i can see that it connects to the database successfully.

    What i need to do is execute this exe remotely, from a machine, call it Source. For this, I use PsTools. Note that I execute this code logged with my windows account (on the same domain than the machine Target) Below is the c# code I use to execute this file.

    public static bool Execute(List<string> tablesNames)
    {
    //the process to start
    const string processName = @"C:\script\MyProgram.exe";
    var serverName = "theServerName";
    //params for MyProgram.exe
    var param = "-s " + String.Join(" ", tablesNames);

    try
    {//example: c:\pstools\psexec.exe \\theServerName C:\script\MyProgram.exe -s tableName1 tableName2
    //Start the process
    ProcessStartInfo info = new ProcessStartInfo("C:\\PsTools");
    info.FileName = @"C:\PsTools\psexec.exe";
    info.Arguments = $@"\\{serverName} {processName} " + param;
    info.RedirectStandardOutput = true;
    info.UseShellExecute = false;
    Process p = Process.Start(info);

    Console.WriteLine( "Program " + processName + " was started correctly.");
    return true;
    }
    catch (Exception ex)
    {
    Console.WriteLine( ex.ToString());
    return false;
    }
    }


    The error I get on the log of the machine Target is:


    System.Data.Odbc.OdbcException (0x80131937): ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

    Notes:

    • the datasource is a 32-bit system DSN on machine Target.
    • Both Source and Target machines are 64-bit.

    As I previously said, executing MyProgram.exe works well when i run it directly from machine Target.

    Any ideas on what I may have done wrong ?

    Continue reading...

Compartilhe esta Página