Click here to Skip to main content
15,886,840 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Get CultureInfo Use VC Pin
Chandrasekharan P5-Jul-09 21:39
Chandrasekharan P5-Jul-09 21:39 
GeneralRe: Get CultureInfo Use VC Pin
jeansea5-Jul-09 21:49
jeansea5-Jul-09 21:49 
GeneralRe: Get CultureInfo Use VC Pin
Chandrasekharan P5-Jul-09 21:52
Chandrasekharan P5-Jul-09 21:52 
Questionerror C2065: '_Application' : undeclared identifier Pin
Davitor5-Jul-09 20:09
Davitor5-Jul-09 20:09 
AnswerRe: error C2065: '_Application' : undeclared identifier Pin
Stuart Dootson5-Jul-09 21:52
professionalStuart Dootson5-Jul-09 21:52 
GeneralRe: error C2065: '_Application' : undeclared identifier Pin
Davitor6-Jul-09 0:27
Davitor6-Jul-09 0:27 
QuestionRe: error C2065: '_Application' : undeclared identifier Pin
David Crow6-Jul-09 3:45
David Crow6-Jul-09 3:45 
QuestionException Handling using catch(...) [modified] Pin
vijay.victory5-Jul-09 20:05
vijay.victory5-Jul-09 20:05 
Hi Experts,

I m doing a databse application using CDatabase and CRecordset classes. The Database is created dynamically using Catalog.
 _CatalogPtr m_pCatalog  = NULL;
				 CoInitialize(NULL);
		         m_pCatalog.CreateInstance(__uuidof (Catalog));
			
m_pCatalog->Create((const char *)(CString("Provider =Microsoft.Jet.OLEDB.4.0;Data Source=" + csAccessDbname)));

I have two Queries.

1>. I have handle the exception using CDBExceptionand a general exception handler Catch(...).But for the following statement,
UserRs.Open(CRecordset::snapshot,Sql,CRecordset::none);
an exception occurs but could not caught by CDBException but caught in Catch(...) block. But the prbm is I couldnt understand the reason.
I want to Show the Exception in Catch(...) Block.

2>. My code is as follows :
try
	{
		  UserCn.OpenEx(_T("Driver={Microsoft Access Driver (*.mdb)};" "Dbq=" + csAccessDbname + ";"),CDatabase::noOdbcDialog);  
	  }
           //Exception occurd here
	  UserRs.Open(CRecordset::snapshot,Sql,CRecordset::none);	  
	}	
	catch(CDBException cdb)
	{ 
	  MessageBox(NULL,cdb.m_strError ,"fnInitFromFile_CDBException",0);
	}
	catch(CException ce)
	{
	  AfxMessageBox(ce.ReportError());	  
	  AfxMessageBox("CException..inside fnInitFromFile");
	}
	catch(...)
	{ 	  //Exception caught here
	  MessageBox(NULL,"CRecordSetfailed.. ","fnInitFromFile_Exception",0);	  	  
	}


This code works fine for my machine but on others machine.
It create database and Exception is occured at UserRs.Open() statement.

PLz Help me..
I m trying my all ways to solve this problem..
Thnx is advance..
waitnng for ur valuable response..



I have never failed,I just found 1000 ways that never works.
Regards,
Victory.

modified on Monday, July 6, 2009 2:28 AM

AnswerRe: Exception Handling using catch(...) Pin
Cedric Moonen5-Jul-09 20:30
Cedric Moonen5-Jul-09 20:30 
GeneralRe: Exception Handling using catch(...) Pin
vijay.victory5-Jul-09 20:35
vijay.victory5-Jul-09 20:35 
AnswerRe: Exception Handling using catch(...) [modified] Pin
Stuart Dootson5-Jul-09 21:50
professionalStuart Dootson5-Jul-09 21:50 
GeneralRe: Exception Handling using catch(...) Pin
vijay.victory5-Jul-09 23:27
vijay.victory5-Jul-09 23:27 
GeneralRe: Exception Handling using catch(...) Pin
Stuart Dootson5-Jul-09 23:45
professionalStuart Dootson5-Jul-09 23:45 
GeneralRe: Exception Handling using catch(...) Pin
vijay.victory6-Jul-09 0:13
vijay.victory6-Jul-09 0:13 
GeneralRe: Exception Handling using catch(...) Pin
vijay.victory6-Jul-09 0:44
vijay.victory6-Jul-09 0:44 
QuestionMFC multi-views print Pin
windyhigh5-Jul-09 18:19
windyhigh5-Jul-09 18:19 
AnswerRe: MFC multi-views print Pin
windyhigh5-Jul-09 22:05
windyhigh5-Jul-09 22:05 
QuestionDesign suggestion and the decorator design pattern Pin
The_Bob5-Jul-09 12:29
The_Bob5-Jul-09 12:29 
QuestionMy Heap implementation is not working...please have a look frnds.. Pin
pavarathyRock5-Jul-09 5:03
pavarathyRock5-Jul-09 5:03 
AnswerRe: My Heap implementation is not working...please have a look frnds.. Pin
Iain Clarke, Warrior Programmer5-Jul-09 6:31
Iain Clarke, Warrior Programmer5-Jul-09 6:31 
AnswerRe: My Heap implementation is not working...please have a look frnds.. Pin
harold aptroot5-Jul-09 7:54
harold aptroot5-Jul-09 7:54 
GeneralRe: My Heap implementation is not working...please have a look frnds.. Pin
pavarathyRock6-Jul-09 5:22
pavarathyRock6-Jul-09 5:22 
GeneralRe: My Heap implementation is not working...please have a look frnds.. Pin
harold aptroot6-Jul-09 5:30
harold aptroot6-Jul-09 5:30 
GeneralRe: My Heap implementation is not working...please have a look frnds.. Pin
pavarathyRock6-Jul-09 6:11
pavarathyRock6-Jul-09 6:11 
GeneralRe: My Heap implementation is not working...please have a look frnds.. Pin
harold aptroot6-Jul-09 6:44
harold aptroot6-Jul-09 6:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.