1

I want to open Access database without displaying any dialog box ( incase of an error )

The code that I use is

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. 
4

0 回答 0