title: Run time error Unrecognized database while exporting data from excel 2010 to Access table 2010 using excel vba
body: <p>I have a table in Access 2010 db with same column names as the column names in excel sheet. I have to delete Access table data content before pumping data from my macro enalbed excel 2010 sheet into it.For now I m trying to see/test if I could pump my excel data to empty table in Access. Once I get this working, I could get 'delete content before dumping excel data' working. </p>
  
  <p>Here's my excel vba macro code:</p>
  
  <pre><code>Sub ADOFromExcelToAccess()
  'exports data from the active worksheet to a table in an Access database
  Dim cn As ADODB.Connection, rs As ADODB.Recordset, r As Long
  ' connect to the Access database
  Set cn = New ADODB.Connection
  cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " &amp; _
      "Data Source=C:\Users\shress2\Documents\TSS_Certification\TSS_Certification.accdb;"
  ' open a recordset
  Set rs = New ADODB.Recordset
  rs.Open "t_certification_051512", cn, adOpenKeyset, adLockOptimistic, adCmdTable
  ' all records in a table
  r = 2 ' the start row in the worksheet
  Do While Len(Range("A" &amp; r).Formula) &gt; 0
  ' repeat until first empty cell in column A
      With rs
          .AddNew ' create a new record
          ' add values to each field in the record
          .Fields("Role") = Range("A" &amp; r).Value
          .Fields("Geo Rank") = Range("B" &amp; r).Value
          .Fields("Geo") = Range("C" &amp; r).Value
          ' add more fields if necessary...
          .Update ' stores the new record
      End With
      r = r + 1 ' next row
  Loop
  rs.Close
  Set rs = Nothing
  cn.Close
  Set cn = Nothing
  </code></pre>
  
  <p>End Sub</p>
  
  <p>I added Tools--> References and selecting Microsoft ActiveX Data Objects 6.0 Object Library.</p>
  
  <p>I m getting Run-Time error' -2147467259(80004005)':
  Unrecognized database format 'C:\Users\shress2\Documents\TSS_Certification\TSS_Certification.accdb</p>
  
  <p>Any reasons why? And how do I fix it? Thanks.</p>