Urgent help needed!
-
Hi, is there any way through which i can check into the Access database wheteher the table is created or not?
-
you can check the MSysObjects table. or search for something like: m_pConnection->OpenSchema((ADOCG::SchemaEnum)eSchema) it returns a recordset with some infos about the DB
Hi, thanks for reply. I am new to databases,so i am not able to implement your suggestion into code. I am sending my present code .It will be of great help,if you show me direction from here. CString sDriver; sDriver = _T("MICROSOFT ACCESS DRIVER (*.mdb)"); CString sDsn; sDsn.Format(_T("ODBC;DRIVER={%s};DSN='';DBQ=%s"),sDriver,sInstallDir + _T("\\v010\\Program\\MDD.mdb")); if(!m_pDatabase->IsOpen()) { m_pDatabase->Open(NULL,FALSE,FALSE,sDsn); } ............................................................. //HERE I NEED THE CODE TO CHECK WHETHER THE DATABASE HAS ANY TABLES ,IF YES ,I NEED TO DELETE THOSE TABLES. .............................................................. I DON'T KNOW HOW TO GET CONNECTION OBJECT HERE BECAUSE I DON'T FIND ANYTHING LIKE CONNECTION OBJECT WHILE USING ODBC,CDATABASE AND CRECORDSET CLASS. .................................................................... ANY HELP WILL BE GREATLY APPRICIATED. .......................................... THANKS AND REGARDS.