Hi All,
In my application i am using a document to display data present in the database.
First I try to run a query in the database and when i try to display the contents of the result it is failing to display the contents. But when I try to copy from the table from the database and update it is getting updated but when executing a query it is not get updated.

Could you please let me know whether there is any specific way to be followed to display the result of a query?


Your post reads something like "I put bread in the toaster, left it for a while and it came out charcoal - I suspect the line voltage".

Try posting some actual code, or maybe even just try to debug your code.

Using a debugger is a good approach, but you could get serviceable answers by repeatedly placing in the code things like printf("Got to the start of the foo() function with parameters %d %d %s\n",a,b,c); A good place to start with prints is about half-way between the database query and the display. Then use http://en.wikipedia.org/wiki/Divide_and_conquer_algorithm to decide which half of the code has the problem.

Yhis is the part of the code which is trying to fetch a data from database and trying to update it on a multi document template

CMultiDocTemplate* pTemplate = GetRqdDocTemplate();
m_pDocument =(CRqtDoc*)pTemplate->OpenDocumentFile(NULL);
//Set the parameters and  pass to the document
	m_pDocument->m_pRqteSet = m_pRqtSchCatSet;
	m_pDocument->m_pRqtXFace = this;
	CDocTemplate* pTemplate;
   POSITION pos = AfxGetApp()->GetFirstDocTemplatePosition();   

		pTemplate = (CDocTemplate*)AfxGetApp()->GetNextDocTemplate(pos);
   return (CMultiDocTemplate*)pTemplate;