简体   繁体   中英

How can i open a MSAcess Database in win7 64 bit OS using CPP?

All i need to do is to open the MSAcess DB in 64 bit operating system.My code works fine in 32 bit operating sytems but when ported to 64 bit ,the open function throws an exception "Database operation Failed".My code part is as follows

//Code
CDatabase* m_pDatabase;
m_pDatabase = new CDatabase();
string szConnect = Driver={Microsoft Access Driver (*.mdb)};Dbq=E:\Application Files\Database\PLConfig.mdb
m_pDatabase->OpenEx(szConnect.c_str());

The Jet (.mdb) driver is not for 64 bit, you need the ACE drivers for 2010 and a suitable connections string ( http://www.connectionstrings.com/access-2007/ )

Driver={Microsoft Access Driver (*.mdb, *.accdb)}

Microsoft Access Database Engine 2010

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM