locked
Run-time Error No.2147467259 (80004005) RRS feed

  • Question

  • Hello,

    I'm learning Database management from a text book named "Access 2016 Programming by Example" by Julitta Korol.

    While writing the example below, I ran into a run-time error as mentioned in the title above. 

    Needless to say that all the requirements like Make a User DSN are accomplished.

    I'm using a windows 10 64 bit and access 2016, all of them are up to date.

    The error occurred when running the subroutine at line 5, which begins with "Conn.Open "Provider..."

    This is the code:

    Sub Open_AndRead_dBaseFile()
        Dim Conn As ADODB.Connection
        Dim rst As ADODB.Recordset
        
        Set Conn = New ADODB.Connection
        Conn.Open "Provider=MSDASQL;DSN=MyDbaseFile;"
        
        Debug.Print Conn.ConnectionString
        
        Set rst = New ADODB.Recordset
        rst.Open "Customer.dbf", Conn
        
        Do Until rst.EOF
            Debug.Print rst.Fields(1).Value
            rst.MoveNext
        Loop
        
        rst.Close
        Set rst = Nothing
        Conn.Close
        Set Conn = Nothing
        
    End Sub
    
     

    The error says:

    [Microsoft][ODBC Driver manager] The specified DSN contains an architecture mismatch between the Driver and Application.


    • Moved by litdev Wednesday, October 5, 2016 5:40 PM
    Wednesday, October 5, 2016 5:33 PM