Just found out the reason for a very weird ADO bug: after some time our software (middle tier service) returned no records anymore. No errors, it executed the queries but just no results. After adding some debug code to read the recordcount (select * from ()) I got an ADO error:

Just found out the reason for a very weird ADO bug: after some time our software (middle tier service) returned no records anymore. No errors, it executed the queries but just no results. After adding some debug code to read the recordcount (select * from ()) I got an ADO error: 

"Either BOF or EOF is True, or the current record has been deleted; the operation requested by the application requires a current record."

What? Recordsaffected was > 0 so it had results, but I could not read the results? Seems this was fixed back in 1999?
http://support.microsoft.com/kb/230101/nl

After moving our printing stuff in a different sub process (separate sandbox so main BO stuff would still work if printing would corrupt something) the main service kept working OK but then we got "record not found" errors in our printing process! 
Finally, after a lot of logging (SQL Server Profiler) and debugging and trial and error I could reproduce the problem...

Solution: do NOT use "--CROSS APPLY" in your query!
That's all! Don't know if it is related to Delphi, FastReport, ADO or whatever yet, but after removing the complete commented sentence from the query: all works fine...

wow, another day wasted for such a stupid bug... :(
http://support.microsoft.com/kb/230101/nl

Comments

Post a Comment