Error in importing from excel

  • Hi guys,

    our dev is getting this error when they try to import a query:

    "The OLE DB provider "Microsoft.Jet.OLEDB.4.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 2

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

    This is the script:

    set @sql = '

    select * from OpenRowset(' +

    '''Microsoft.Jet.OLEDB.4.0'',' +

    '''Excel 8.0;hdr=no;imex=1;Database=\\' + @Servername + '\upload\'+@filename+''','' select * from [NPADataToUploaf$] ' +

    'where [f1] is not null and [f2] is not null ' +

    'and [f3] is not null and [f4] is not null and [f5] is not null ' +

    'and [f6] is not null ' +

    --Exclude header

    'and [f1] <> ''''Employee Number'''' and [f2] <> ''''Last Name'''' ' +

    'and [f3] <> ''''First Name'''' and [f4] <> ''''Nature Of NPA'''' and [f5] <> ''''Effective Date Of NPA'''' ' +

    'and [f6] <> ''''New Salary'''' ' +

    ''')'

    Any ideas?

    Thank you in advance for your help!

  • The JET OLE DB provider is only available in 32-bit, so the query needs to run in 32-bit as well.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply