OPENROWSET and EXCEL

  • I having an excel file called TEST.XLS which has 3 columns & 8 rows

    c0 c1 c2

    1 a A

    2 b B

    3 c C

    4 d D

    5 e E

    6 f F

    7 g G

    8 h H

    when i runnig the following query

    SELECT * FROM OPENROWSET('MSDASQL'

    , 'Driver=Microsoft Excel Driver (*.xls);DBQ=C:\Test.xls;'

    , 'SELECT * FROM [Sheet1$]')

    i am getting error like this

    Server: Msg 7399, Level 16, State 1, Line 1

    OLE DB provider 'MSDASQL' reported an error. 

    [OLE/DB provider returned message: [Microsoft][ODBC Excel Driver] The Microsoft Jet database engine could not find the object 'Sheet1$'.  Make sure the object exists and that you spell its name and the path name correctly.]

    OLE DB error trace [OLE/DB Provider 'MSDASQL' IColumnsInfo::GetColumnsInfo returned 0x80004005:   ].

    Anybody having any suggestions to this problem

    Thanks in advance & waiting for the reply


    Philip

  • http://www.connectionstrings.com

    Also, there are massive information here

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926

     


    N 56°04'39.16"
    E 12°55'05.25"

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

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