Problems with provider Microsoft.ACE.OLEDB.12.0 RRS feed

  • Question

  • Hello to everybody, I'm new in this forum and I want to know if somebody can help me.

    I want to upload an excel file to SQL and I did this:

     DECLARE @SQL         nvarchar(MAX)
     DECLARE @FileName    nvarchar(MAX)
     SET @FileName = 'd:\StandardWorkingTime\OracleDownloads\Atributos\120112 PLANNIG ITEM ATRIBUTES DRPA.xls'  

        IF NOT OBJECT_ID(N'dbo.tmpTEST') IS NULL
           DROP TABLE dbo.tmpTEST;   

        SET @SQL = N'SELECT * INTO dbo.tmpTEST FROM OPENROWSET(''Microsoft.ACE.OLEDB.12.0'',''Excel 12.0;Database=' + @FileName + ''', [Sheet1$]) as a'

        EXEC sp_executesql @SQL;
        select * from dbo.tmpTEST 

    and I got the following error:


    Msg 7399, Level 16, State 1, Line 1

    The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" reported an error. The provider did not give any information about the error.

    Msg 7303, Level 16, State 1, Line 1

    Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".

    Somebody have any idea for this issue.

    Thanks for you help.





    Saturday, January 14, 2012 5:26 PM


All replies