I have a stored procedure which is erroring with "Timeout expired".
The code involved is ADO/VB6.
The stored procedure itself is not a problem, you can run it in a query window and it takes less than a second.
The code used to get the connection etc is also modularised and in use all over a huge application. It is only in this one place that the timeout occurs, on one particular database.
The error will be reproducable every time for hunderds of attempts, whether running the VB6 code in debug or not, then suddenly everything will magically start working again. Then some time in the future the same problem will show up again.
I'm not sure how much code to put here, there's nothing complex about it; it's basically;
Set adoCommandObject.ActiveConnection = ...{open ADODB.Connection object}
Set rs = CreateObject("ADODB.Recordset")
Call rs.Open(adoCommandObject, , adOpenForwardOnly, adLockReadOnly)'Timeout occurs here
I've been watching in profiler but that hasn't given any clues, except for occasionally seeing "SET NO_BROWSETABLE ON" / "SET NO_BROWSETABLE OFF" statements occurring before and after the sp runs.
I've searched the net but not been able to find any satisfactory help for this; I'm willing to try anything at this point (except rewrite in .NET, unfortunately that's not an option!)