locked
Unspecifed error on Oledbconnection open RRS feed

  • Question

  • Hi,

    I am trying to read a excel file and populate the data into datatable.

    OleDbConnection

     

    selectConnection = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + strExcelFilePath + ";Extended Properties=Excel 12.0;"

    );

    selectConnection.Open();

     

    OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM [Sitelist$]"

    , selectConnection);

     

    this.datatable = new DataTable

    ();

    adapter.Fill(

    this

    .datatable);

    objDataVariable =

    this

    .datatable;

    selectConnection.Close();

    This operation is performed when an the particular excel file is checkedin from a sharepoint site. When checkin operation is performed, the excel file is temporarily copied to a folder('strExcelFilePath') present on the server. The code runs fine when the file checkedin but I get 'Unspecified error' at line selectConnection.Open(); when the checkin is perfomed by a user who is not having any access to the server except for 'read and execute' access to the folder where the file is temporarily created. The user who performs checkin operation has Site Onwer access to the sharepoint site. Please let me know the how to resolve this issue.

    Thank you.

    Regards,

    Kiran

    Wednesday, July 27, 2011 3:27 PM

Answers

All replies