1

I have a PowerBuilder.net console application that uses SQLNCLI10 to connect a SQL Server 2008 R2. This applications needs to be executed from a ASP.NET MVC website hosted in the same server, and its output readed.

This is the code for executing the application on the MVC:

var proc = new System.Diagnostics.Process
{
    StartInfo = new System.Diagnostics.ProcessStartInfo
    {
        FileName = ConfigurationManager.AppSettings["PB_EXE"],
        Arguments = Credentials.ClientId + " " + reference,
        UseShellExecute = false,
        RedirectStandardOutput = true,
        WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden
    }
};

When the application is executed from the MVC, the PBTransaction objects returns the generic "Transaction not connected" sql error.

The thing is, the application runs well with a .bat that call the executable with parameters. Even more, a simple WinForms using the same code above, gets the transaction connected successfully.

I have alredy tried setting the ApplicationPool of the website to the administrator of the server, with the same results.

Coneone
  • 292
  • 1
  • 8
  • Could be an authentication issue. When you start your *.exe in a cmd shell then the *.exe is executed with your user rights. When you start the *.exe from your webbrowser i assume webbrowser rights are used, as long as you're not providing a special logon (run as user) . – user743414 Apr 28 '17 at 06:50
  • I didn't mean webbrowser, I mean webserver. :P – user743414 Apr 28 '17 at 09:55

1 Answers1

0

What I'd check first to solve connectivity issues on a PB.NET console application.

  1. Putting some logging into the console application and examine the Transaction object immediately before and after attempting the connection. It will likely provide necessary information to identify the culprit.
  2. Make sure PowerBuilder database connectivity run-time libraries (e.g. PBORA010.DLL) are installed on the server and accessible to the role running the application.
  3. If the connection uses ODBC/JDBC make sure any DSNs needed on server are accessible to the console application.
Rich Bianco
  • 4,141
  • 3
  • 29
  • 48