BDE "Invalid cursor handle"

My application is developped under Delphi 4 and use BDE tu connect to a MS
Sql Server 7.0.

Sometime i receive a strange "Invalid cursor handle" which will cause an
ENoResultSet exception. I have a TQuery which run a stored procedure that
return a result set. I think the problem is in BDE, but for the moment i con
not think to rewrite the application using ADO or something else. I can
avoid this error with this code, but i think this is not a solution....

var StillTry: Boolean;

              StillTry := True;
              NrRetry  := 5;
              while StillTry do
                 Active := True;
                 StillTry := False;
                 on E: ENoResultSet do begin
                   StillTry := True;
                   if NrRetry < 1 then
                 on E: Exception do
//                    raise Exception.Create('Error :

    If anybody know something about this please let me know !

Thanx in advance,
Bogdan Dragulin