OLEDBConnection.Open () generates a 'Unspecified error'

I have an application that downloads an Excel.xls file to the file system, opens a file with an oledbconnection object using the .open () method of the object instance, and then saves the data in the database. Uploading and writing a file to the file system works fine, but I get an error when I try to open the file on our production server only . The application works fine on two other servers (development and testing servers).

The following code throws a "Unspecified Error" in Exception.Message.

Quote:

        System.Data.OleDb.OleDbConnection x = new System.Data.OleDb.OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + location + ";Extended Properties='Excel 8.0;HDR=Yes;IMEX=1'");
        try
        {
            x.Open();
        }
        catch (Exception exp)
        {
            string errorEmailBody = " OpenExcelSpreadSheet() in Utilities.cs.  " + exp.Message;
            Utilities.SendErrorEmail(errorEmailBody);
        }

: End quote

Server c: \\ temp and c: \ Documents and Settings \\ aspnet \ local settings \ temp folder provide full control \ aspnet.

, - , , , /, Excel. , -. Windows 2000 SP4.

+3
6

, Windows/Access Jet DB Engine, 64/255, . 255 / 64 (?) , . , , . Conn.close(); , . , Excel .

+3

? 64- ? OLEDB 64- . x86. 64- .

0

. . IMEX = 1, .. dev .:) , dev , prod.

0

System.Data.OleDb.OleDbConnection x = new System.Data.OleDb.OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" + location + "';Extended Properties='Excel 8.0;HDR=Yes;IMEX=1'");
0

, - / aspnet.

0

I got this error about rights, but it looks like you have it. I also saw him with one of the flags in the connection string - you can play a little with him.

-1
source

Source: https://habr.com/ru/post/1697154/


All Articles