none
vb.net Unrecognized database format

    Question

  • Dim con As OleDb.OleDbConnection = New OleDb.OleDbConnection()
    
    
    
    Dim command As OleDb.OleDbCommand = New OleDb.OleDbCommand()
    
    
    
    Dim reader As OleDb.OleDbDataReader
    
    
    
    con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Toby\Desktop\calendar.accdb"
    
    
    
    command.Connection = con
    
    
    
    con.Open()
    
    
    
    

    hi this is my code i'm woking with a access 2008 and vs 2008

    and it gives me an error

    Unrecognized database format

     

     

    Wednesday, September 01, 2010 2:48 PM

Answers

  • con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Toby\Desktop\calendar.accdb"
    

    Try the above connection string.  If that doesn't work then the other thing you can do is change the database format from 2007-2010 to 2000/2002/2003 format and use the old connection string. 

    Also, for reference here's a site which contains connection strings for all kinds of databases (and database versions):

    http://www.connectionstrings.com/

     

    • Proposed as answer by jwavila Wednesday, September 01, 2010 3:16 PM
    • Marked as answer by Liliane Teng Tuesday, September 07, 2010 8:04 AM
    Wednesday, September 01, 2010 2:54 PM

All replies

  • con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Toby\Desktop\calendar.accdb"
    

    Try the above connection string.  If that doesn't work then the other thing you can do is change the database format from 2007-2010 to 2000/2002/2003 format and use the old connection string. 

    Also, for reference here's a site which contains connection strings for all kinds of databases (and database versions):

    http://www.connectionstrings.com/

     

    • Proposed as answer by jwavila Wednesday, September 01, 2010 3:16 PM
    • Marked as answer by Liliane Teng Tuesday, September 07, 2010 8:04 AM
    Wednesday, September 01, 2010 2:54 PM
  • thank you it works

     

    Wednesday, September 01, 2010 3:05 PM
  • You're welcome, glad to help. :) 
    Wednesday, September 01, 2010 3:32 PM
  • hi sweetie, really you helped me, thank u, i am Hamada from KSA, again thank u
    Thursday, January 26, 2012 1:59 AM