Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: Excel ODBC Driver Cannot Open Excel 4.0 XLS Files


View products that this article applies to.

This article was previously published under Q293862

↑ Back to the top


Symptoms

If you try to open a Microsoft Excel 4.0 file, the ODBC Microsoft Jet driver may return the following error message:
[Microsoft][ODBC Excel Driver] The Microsoft Jet database engine could not find the object 'ODBCTest.xls'. Make sure the object exists and that you spell its name and the path name correctly.

↑ Back to the top


Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Microsoft Jet 4.0 Service Pack 5. For additional information about the latest Jet 4.0 service pack, click the following article number to view the article in the Microsoft Knowledge Base:
239114� How To: Obtain the Latest Service Pack for the Microsoft Jet 4.0 Database Engine

↑ Back to the top


More information

Steps to Reproduce Behavior

The following steps only reproduce the error on a computer with Microsoft Jet 4.0 Service Pack 4 or earlier.
  1. Create a data source name (DSN) called ExcelTest for an Excel 4.0 file.
  2. Create a new Standard EXE project in Microsoft Visual Basic.
  3. Set a project reference to Microsoft ActiveX Data Objects 2.6..
  4. Paste the following code into the code section of Form1:
    Option Explicit
    
    Const strConn = "DSN=ExcelTest"
    Const strSQL = "SELECT * FROM [Sheet1$]"
    
    Private Sub Form_Load()
        Dim cn As ADODB.Connection
        Set cn = New ADODB.Connection
        cn.Open strConn
        
        Dim rs As ADODB.Recordset
        Set rs = New ADODB.Recordset
        With rs
            .CursorLocation = adUseClient
            .Open strSQL, cn
            
            Debug.Print .Fields(0)
            
            .Close
        End With
        
        Set rs = Nothing
        cn.Close
        Set cn = Nothing
    End Sub
    					
  5. Run the project. Notice that you receive the above-mentioned error message.

↑ Back to the top


Keywords: kbdatabase, kbfix, kbiisam, kbjet, kbmdacnosweep, kbvs600sp5fix, kbbug, KB293862

↑ Back to the top

Article Info
Article ID : 293862
Revision : 5
Created on : 11/25/2003
Published on : 11/25/2003
Exists online : False
Views : 479