CompuServe Thread

Max no of CRecordsets?

1 messages in this thread
#30489From: NANOsystems MesstecJul 11, 1994 7:44 AM
Well, I have found a solution for my problem (it was in the KBase). Search for CRecordset and Bug. There is a bug in the CRecordset destructor. Each CRecordset::Open call creates a temporary file in the TEMP directory. If you delete your CRecordset derived object without expocitly closing it before, the connection to the data base does not close correctly, and the temp file remains open. If you create and delete CRecordset objects dynamically, this very soon causes a 'number of files overflow', giving very strange errors. Solution: Derive a class CMyRecordset and overload the destructor: class CMyRecordset : public CRecordset { public: virtual ~CMyRecordset() { Close(); } }; This will close and remove the temp file. Norbert