locked
Windows Service OLEDB-connection to Excel-file RRS feed

  • Question

  • I have a Windows Service that hangs when opening an OLEDB-connection to an Excel-file, like this:
    -----------------------
    using (var connection = new OleDbConnection(
    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" 
    + fileName + ";Extended Properties=\"Excel 8.0\""))
    {
    connection.Open();
    // start using the connection
    }
    -----------------------
    This code works fine when running as a console application. When I debug the Windows Service with Visual Studio, I can step into the code until I hit the call to connection.Open()
    Thursday, February 21, 2019 4:09 PM

Answers

All replies