title: powershell 2.0 on Windows server 2008 R2 cannot connect with OLEDB connection
body: <p>I developed a powershell application on an XP box that made an OLEDB connection to a Sybase server to extract data that is then inserted into a SQL Server 2008 database instance. After debugging this script and ensuring the process operated correctly, I moved the script to a new Windows Server 2008 R2 box. In order to connect to the Sybase instance I installed the Sybase 12.5.2 client as I had done on the XP box. However, running the script failed with the message:
       Exception calling "open" with "0" argument(s): "The 'Sybase.ASEOLEDBProvider.2' provider is not registered on the local machine.</p>
  
  <p>The base connection string was derived from connectionStrings.com and worked on the XP so I do not believe there is a syntax issue per se. So, I manually registed the OLEDB dll with the command:
      regsvr32 sydaase.dll</p>
  
  <p>it registered with no errors.</p>
  
  <p>Cutting out the pertinent lines of the script, the connection logic sequence is
     $dbConn = new-object System.Data.oldeb.oledbConnection
     $dbConn.connectionString = "Provider=Sybase.ASEOLEDBProvider.2; server name = myServer; port address = xxx; initial catalog = xxx; user Id = xxx; Password = xxxx"</p>
  
  <p>I have replaced my data with xxx in this example.</p>
  
  <p>I am not clear why this ran without issue on the XP box, but is failing to do so on the Windows Server box though I followed the same configuration process.</p>