Random crash when ADO::Connection->close() is called



Hi,

I am working on a performance counter dll. In its collect function
database (access database) is queried to get the performance counter
information. The psuedo code is as below -


Collect()
{
CoInitialize(NULL);
{
ConnectionPtr connPtr;
connPtr.CoCreateInstance;


// Fetch data from database
connPtr.Close()// Crash here
connPtr.Release()



}
}


The crash occurs randomly when I call connPtr.Close(). The crash
occurs if I keep perfmon application running for around 10 mins
(sampling interval is 15 seconds).

So ConnPtr.Close() executes successfully for around 10 mins then it
crashes.
What could be the reason?

I am stuck here
any help is appreciated.

Thanks,
sachin
.



Relevant Pages