none
Connecting to Access 2010 Database RRS feed

  • Question

  • Sorry if this is a duplicate post but there are so many I can't figure out what applies to me.

    I had a .NET 2003 application that connected to an Access 2000 database using ODBC.

    I upgraded this to .NET 2008 and  Access 2010 in a Windows 7 environment.

    My connection string used to be

    "PageTimeout=5;DSN=MS Access Database;DefaultDir=" & dbpath & ";DriverId=25;DBQ="C:\MGSDATA_VB\Access_MGSDATA_2010.mdb;FIL=MS"

    That gave me a data architecture error when I tried to connect. 

    I downloaded the Access 2010 database engine and changed the connection string to:

     "Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\MGSDATA_VB\Access_MGSDATA_2010.mdb"

    Now I get this message when I try to connect:

    [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

     

    What is the problem?  I'm certain that the path on my C: drive is correct since it worked on the old version.

    Thanks

    Wednesday, January 5, 2011 5:07 PM

Answers

  • First you might want to consider using the ACE OLEDB Provider instead of ODBC. That would have been installed with the Access 2010 database engine.

    Second, I'm not sure whether you have changed the Platform option (under Build...Configuration Manager) of your project to x86. This will enable the app to run 32-bit (in 64-bit WoW) instead of native 64-bit. I don't believe there is a 64-bit ODBC driver for Access so you would need to run 32-bit if you continue to use the ODBC driver.


    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by mh1hepvb Friday, January 7, 2011 1:54 AM
    Thursday, January 6, 2011 2:05 PM

All replies

  • Just in case anyone asks, I have windows 7 home premium 64 bit edition.  The Access Database engine was the 32 bit version
    Wednesday, January 5, 2011 6:06 PM
  • First you might want to consider using the ACE OLEDB Provider instead of ODBC. That would have been installed with the Access 2010 database engine.

    Second, I'm not sure whether you have changed the Platform option (under Build...Configuration Manager) of your project to x86. This will enable the app to run 32-bit (in 64-bit WoW) instead of native 64-bit. I don't believe there is a 64-bit ODBC driver for Access so you would need to run 32-bit if you continue to use the ODBC driver.


    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by mh1hepvb Friday, January 7, 2011 1:54 AM
    Thursday, January 6, 2011 2:05 PM
  • Thanks very much.  I have to say I really wasn't expecting such an esoteric solution to work but it did.  Who knew 64/32 bit conflicts could cause a problem like this.  I went into config manager in Build and just changed the platform type to x86, and nothing else, and it worked!!

     

    thanks again

     

     

    Friday, January 7, 2011 1:58 AM