Error 3343: Unrecognized database format 'C:\Temp\Northwind.accdb"

Anonymous
2013-05-20T14:58:48+00:00

I am tasked with connecting to an Access DB from a Word 2010 Macro.  I downloaded the Microsoft sample database and the sample verification code but that does not work either.  I can open the Access database so it does not appear to be corrupted.  Using the following VBA code it appears that I am able to find the database but not open it.

When I execute the following code I receive the Error 3343: Unrecognized database format 'C:\Temp\Northwind.accdb" on the line

                                                 Set dbNorthwind = OpenDatabase(Name:="C:\Temp\Northwind.accdb")

Since I am using Microsoft's sample Access DB and Sample code what am I doing wrong and how do I correct this issue. 

Thanks,

Sub UsingDAOWithWord()

 Dim docNew As Document

 Dim dbNorthwind As DAO.Database

 Dim rdShippers As Recordset

 Dim intRecords As Integer

 'Set docNew = Documents.Add

 Set dbNorthwind = OpenDatabase(Name:="C:\Temp\Northwind.accdb")

 Set rdShippers = dbNorthwind.OpenRecordset(Name:="Shippers")

 For intRecords = 0 To rdShippers.RecordCount - 1

 docNew.Content.InsertAfter Text:=rdShippers.Fields(1).Value

 rdShippers.MoveNext

 docNew.Content.InsertParagraphAfter

 Next intRecords

 rdShippers.Close

 dbNorthwind.Close

End Sub

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2013-05-20T18:34:09+00:00

Make sure you have made a reference to the correct DAO library (in VBA, in Tools->References). The old one, for .mdb files only, has DAO in its name. For .accdb files you need the new one, which is called "Microsoft Office 12.0 Access database engine Object Library" (or 14.0, for Office 10).

Was this answer helpful?

40+ people found this answer helpful.
0 comments No comments

15 additional answers

Sort by: Most helpful
  1. Anonymous
    2013-06-12T01:41:06+00:00

    This is slightly off topic, and only because I'm anxiously awaiting answers to my other question. This is totally unrelated to the 3343 Flash error right? I did receive one answer so far that says these two errors, albeit the same number, are totally unrelated??

    Was this answer helpful?

    0 comments No comments
  2. Jay Freedman 208.1K Reputation points Volunteer Moderator
    2013-05-21T20:54:25+00:00

    You're certainly welcome!

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2013-05-21T19:29:48+00:00

    Jay;

    With Your quick response and help I now am able to access the DB that I have been tasked with processing and inserting text into a word document. Thank you very much. Your assistance is appreciated.

    Thanks you,

    Bill

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2013-05-21T18:22:51+00:00

    Thanks, figured out the cause of the type missmatch.  Now works.

    Bill

    Was this answer helpful?

    0 comments No comments