CompuServe Messages

Max no of CRecordsets?

    11-Jul-94 07:44:47
Sb: Max no of CRecordsets?
Fm: NANOsystems Messtec 100336,1446
To: Rondal C. Ellifritt 100023,3222
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