Thread: CRecordset::Open() is throwing an exception

  1. #1
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545

    CRecordset::Open() is throwing an exception

    Hi,
    I'm trying to fix a program that interacts with a database, and while stepping through in debug mode I see that the line in red is throwing an exception.
    CustomerPlatform is derived from CRecordset.
    The MSDN isn't very clear on what exactly could cause CRecordset::Open() to throw other than:
    Quote Originally Posted by MSDN
    If the requested type is not supported, the framework throws an exception.
    If snapshot isn't supported, then I don't know how this ever worked in the past since that's what all cases use...
    Code:
    	else if (CustomerPlatform* tmpRecSet = dynamic_cast<CustomerPlatform *>(recSet))
    	{
    		tblName = tmpRecSet->GetDefaultSQL();
    		recName = "Platform ";
    
    		tmpRecSet->m_strUniqueIDParam = inRec.GetUID();;
    		tmpRecSet->m_strFilter = _T("UniqueID = ?");
    
    		tmpRecSet->Open(CRecordset::snapshot); 
    
    		...
    	}
    Any ideas on why it's throwing an exception?

  2. #2
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Nevermind. I fixed it: http://support.microsoft.com/kb/115516/EN-US/
    I don't know how or why, but my TEMP environment variable got messed up...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Exception handling in a large project
    By EVOEx in forum C++ Programming
    Replies: 7
    Last Post: 01-25-2009, 07:33 AM
  2. exception handling
    By coletek in forum C++ Programming
    Replies: 2
    Last Post: 01-12-2009, 05:28 PM
  3. Signal and exception handling
    By nts in forum C++ Programming
    Replies: 23
    Last Post: 11-15-2007, 02:36 PM
  4. help, throwing exception from constructor
    By terracota in forum C++ Programming
    Replies: 5
    Last Post: 07-02-2004, 05:44 PM
  5. Deconstructor throwing exception
    By subdene in forum C++ Programming
    Replies: 13
    Last Post: 06-26-2004, 03:52 AM