I have a C++ .NET 2003 client application using Sybase 15 that is connecting to a Sybase 12.5 database server using ASEOLEDB. The client code builds the connection string and executes a stored procedure by calling the Microsoft library function CCommand::Open.
Most of the time, CCommand::Open returns S_OK and the code continues. However, seemingly randomly, that call will begin to return E_FAIL. The database, stored procedure, and input are all the same. This will last for 20-30 minutes, then seemingly resolve itself and start working again.
When the issue occurs, I can use Toad for Sybase to execute the stored procedure with the same input without issue. I can also use an older build of the client application that uses Sybase 11 that also has no issue. I can also run a script in PowerShell with the same Sybase 15 connection string that also executes successfully.
I suspect some sort of connection pooling difference between the Sybase 11 and Sybase 15 client code to be the issue, but I don't know how to prove it/disprove it/isolate the cause further.
Possible related question: Intermittent Oledb connection error “Cannot open database ''.”