Board index » Visual Studio » Program crashes with ODBC call Any helpful advice is appreciated
|
cwilkin1
|
Program crashes with ODBC call Any helpful advice is appreciated
Visual Studio269
I am having a program with ODBC call to insert a record using the ExecuteSQL statement. The code is as follows //----------------------------------------------- CDatabase db; if(db.OpenEx(DSNName,0)== 0) { AfxMessageBox("Error opening database"); return; } try { db.ExecuteSQL("INSERT INTO XYZ VALUES(x1,x2,x3)"); } catch(CDBException *pExc) { AfxMessageBox(pExc->m_StrError); } //------------------------------------------------ The program raises an exception when I am trying to insert a duplicate record. However when I am trying to handle the exception of type CDBException the program crashes in the exception handler or sometime afterward. Sometimes the error message is access violation and sometimes the program just hangs. The program also crashes at some other times. After checking the program thoroughly I've come here. Please give advice. D.Ramesh - |
