opening ADO data set causes program termination


I have a very strange problem with D5 enterprise, including all the updates
installed, on Win2K Professional.

My application is a MIDAS server, that when a certain operation is required
of it spawns a new thread. This thread starts the COM system, and at some
point opens an ADO data set.

Often, there are no problems, and everything works well. However, every once
in a while opening this data set causes program termination (with process
exit code 128).

I know that this is where the program fails because I use CodeSite to
pinpoint the problem.

Here is my code:

   if (not ThreadData.JobOutputFilesDS.Active) then begin
      Codesite.SendMsg('[Portal Server] - Opening Job Output Files Table');
      ThreadData.JobOutputFilesDS.Parameters[0].Value :=
      Codesite.SendMsg('[Portal Server] - Job Output Files Table is

When trying to debug it in the de{*word*81}, I usually get a too many
consecutive exceptions message.

Any idea what the problem might be and how I can fix it?