Failed to create empty document

How to troubleshoot if I encountered a message box with the following:

Failed to create empty document

Application using Single Document Interface;
Data Access Technology using ODBC; and
Database using Microsoft Access97

Seeking for solution or troubleshooting options.  Thanking in advance.

The followers of Christ
December 18, 1999 - Saturday (15:00GMT)
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Whats the context?
This error means that MFC tried to create a new instance of some CDocument-derived class and the creation failed. The constrcutor probably threw an exception.

Or, the view associated with this document didn't successfully create itself. It's constructor may have thrown an exception, or it simply failed to create the windows it wanted to create.

If you're using ODBC, then your code might have failed while creating or opening your CDatabase or CRecordset objects. (If you're following the structure for such an app put forth by the AppWizard, those objects are owned by the CDocument-derived class. But you should get an error message bout the failure before you get the 'failed to create' error message.)

There's lots of different ways to have these problems manifest themselves, but that's what the erorr message means. You'll need to do a little debugging to detect the exact reason.

..B ekiM

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
i_seek_ee_i_got_expertiseAuthor Commented:
Thanks mikeblas and inpras for both of your answers and comments.

Actually the application of mine was fine with an earlier approach that has been performed with only one view & one recordset.  Later,  with different approach involving three recordsets and two views, I encountered the previously said error message.

Switching between views process were carried out in the CMainFrame class using 2 different handlers:-

i. First View - View the Share Holder information; and
ii.Second View - View the Report which is in the form of query-based.

The neccessary codes found in either view handler are as follows:-

void CMainFrame::OnScreenReport()
  CRuntimeClass* pNewView;
  PNewView = RUNTIME_CLASS (CViewtheCategoryRecord1);  //View the Category Record where it applies to the option made through the menu

  CCreateContext cContext;

  cContext.m_pNewViewClass = pNewView;
  cContext.m_pCurrentDoc = GetActiveDocument();
  CView* pView = STATIC_DOWNCAST(CView, CreateView(&cContext));

  if (pView != NULL)

i_seek_ee_i_got_expertiseAuthor Commented:
Kindly assist me to debug.
Advance thanks.


The followers of Christ
December 19, 1999 - Sunday (12:20 GMT)
What messages are in your debug output window when this happens?

..B ekiM
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.