locked
Jet Engine RRS feed

  • Question

  • I am using the Jet 4.0 engine to access my access files.  However, whenever I create a file with extension .accdb, Microsoft Provider Jet 4.0 returns an error stating the VB does not recognize the file with extension .accdb.  However, it works fine with the .mdb extension files.  My question is what version of the Jet engine should I use to access the .accdb extension files?
    Saturday, September 10, 2011 3:24 PM

Answers

  • Yep, Jet 4.0 only works with Access 2003 (.mdb) and before. You need to use Microsoft.ACE.OleDb.12.0. For example:

    Dim jetConnection As New OleDbConnection
    jetConnection.ConnectionString = "Provider=Microsoft.ACE.OleDb.12.0;Data Source=C:\someFolder\someDb.accdb"
    jetConnection.Open()
    ' ..Anything else you want to do
    

    Most of the options that work with Jet 4.0 (Persist Security Info, Password, etc.) work with ACE.OleDb.12.0 too.

     


    jmh
    • Proposed as answer by Kee Poppy Monday, September 12, 2011 9:23 AM
    • Marked as answer by Kee Poppy Friday, September 16, 2011 7:37 AM
    Saturday, September 10, 2011 4:26 PM
  • Jet 4 doesn't support .accdb, only .mdb.  If you want to support .accdb, you need to use the 2007 Office System Driver (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=23734) [or the 2010 drivers].

     

    Version 4.0 predated the Access 2007 file format.

     


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    • Proposed as answer by Kee Poppy Monday, September 12, 2011 9:23 AM
    • Marked as answer by Kee Poppy Friday, September 16, 2011 7:37 AM
    Saturday, September 10, 2011 4:40 PM

All replies

  • Don't know much about the subject, but did a little research....

    http://wiki.services.openoffice.org/wiki/Connecting_to_Microsoft_Access

    It almost seems in the first few lines of the article on that page insinuate that you should be using “Access Database Engine” (ACE) instead.

    If I'm wrong, I apologize.

    Hope this helps you.


      Microsoft Office 12.0 Access Database Engine OLE DB Provider
    Paul Clement Posted an answer here that may help you:
    http://forums.devx.com/showthread.php?t=48215
    And someone from another website made this code based off of that:
    1. Function CreateQueryDefADOX()
    2.  
    3. Dim cat As New ADOX.Catalog
    4. Dim cnn As New ADODB.Connection
    5. Dim cmd As New ADODB.Command
    6.  
    7. cnn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & FilePathandName & ";Persist Security Info=False;"
    8.  
    9. cat.ActiveConnection = cnn
    10. cmd.CommandText = "Select * from Table1" 'The sql for your query
    11. cat.Views.Append "qryName", cmd 'qryName = whatever you want to call your query
    12.  
    13. cnn.Close
    14. cat = Nothing
    15. cnn = Nothing
    16.  
    17. End Function

    If you want something you've never had, you need to do something you've never done.



    • Edited by Paul Ishak Saturday, September 10, 2011 4:44 PM
    Saturday, September 10, 2011 4:21 PM
  • Yep, Jet 4.0 only works with Access 2003 (.mdb) and before. You need to use Microsoft.ACE.OleDb.12.0. For example:

    Dim jetConnection As New OleDbConnection
    jetConnection.ConnectionString = "Provider=Microsoft.ACE.OleDb.12.0;Data Source=C:\someFolder\someDb.accdb"
    jetConnection.Open()
    ' ..Anything else you want to do
    

    Most of the options that work with Jet 4.0 (Persist Security Info, Password, etc.) work with ACE.OleDb.12.0 too.

     


    jmh
    • Proposed as answer by Kee Poppy Monday, September 12, 2011 9:23 AM
    • Marked as answer by Kee Poppy Friday, September 16, 2011 7:37 AM
    Saturday, September 10, 2011 4:26 PM
  • Jet 4 doesn't support .accdb, only .mdb.  If you want to support .accdb, you need to use the 2007 Office System Driver (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=23734) [or the 2010 drivers].

     

    Version 4.0 predated the Access 2007 file format.

     


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    • Proposed as answer by Kee Poppy Monday, September 12, 2011 9:23 AM
    • Marked as answer by Kee Poppy Friday, September 16, 2011 7:37 AM
    Saturday, September 10, 2011 4:40 PM