我想打开Access数据库而不显示任何对话框(包含错误)
我使用的代码是
CDatabase DB;
CString conString;
CString dbPath = _T("c:\TestDB.mdb");
conString.Format(_T("ODBC;DRIVER={MICROSOFT ACCESS DRIVER (*.mdb)};DSN='';DBQ=%s"), dbPath) ;
DB.OpenEX(conString,CDatabase::noOdbcDialog); // Fails to open the connection
DB.Open(NULL, FALSE, FALSE, conString); // Works well, but displays a dialog box in case of an error.