none
Connecting an Access 2007 application to a VB 2008 application RRS feed

  • Question

  • I'm using Visual Studio 2008 to develop a VB app which uses an Access 2007 database (accdb format). Currently my app is not connected to any data source - I'm trying to add my database as a data source. At the Add Connection dialog, I select the Change button and then choose "Microsoft Access Database File (OLE DB) as the Data source. Once I say OK, the only option remaining in the Add Connection dialog is the ConnectionString. There is no place to enter the name and location of my database file. No matter what I put in the ConnectionString, I get the error "Format of the initialization string does not conform to specification starting at index 0". My questions:
       Am I selecting the right data source?
       Is .NET Framework Data Provider for OLE DB the correct data provider? That's the only option I have when Access is the data source.
       How do I tell VB where my database file is located?
       Is there a way to generate a ConnectionString because what I'm using is not working?

    I've found some instructions on selecting an Access database to VB 2005. These recommend changing the Data source type to <other>. If I do that I can select my database file, but I receive a variety of errors when I select OK depending on what I select for the Data provider.

    Thanks for the help.
    Monday, August 10, 2009 7:12 PM

Answers

  • To connect to Access 2007 database you need to install and use ACE OLEDB provider, not JET OLEDB Provider. I guess this is the reason why you receive this error, since Jet OLEDB provider does not recognize new format of Access 2007 database.
    Val Mazur (MVP) http://www.xporttools.net
    • Marked as answer by Yichun_Feng Monday, August 17, 2009 1:34 AM
    Tuesday, August 11, 2009 3:04 AM
    Moderator

All replies

  • Hi,BPalmer2000,you can connect a Access 2007 database as shown in this page:
    http://www.connectionstrings.com/access-2007

    there is a difference between Accee2003 and Accees2007
    Wenn ich dich hab’,gibt es nichts, was unerträglich ist.坚持不懈!http://hi.baidu.com/1987raymond
    Tuesday, August 11, 2009 1:29 AM
  • To connect to Access 2007 database you need to install and use ACE OLEDB provider, not JET OLEDB Provider. I guess this is the reason why you receive this error, since Jet OLEDB provider does not recognize new format of Access 2007 database.
    Val Mazur (MVP) http://www.xporttools.net
    • Marked as answer by Yichun_Feng Monday, August 17, 2009 1:34 AM
    Tuesday, August 11, 2009 3:04 AM
    Moderator