Related question: http:/Q_24813268.html
In a VB6 application using ADODB, I have 1 point at which 1 customer sometimes gets Error 5, Invalid procedure call or argument.
We have a function for calling Recordset.Open, and it's in the code hundreds of places and working fine. Abridging very slightly, we have:
set rs = OpenDBConnection(sqlString
, adOpenKeyset, adLockOptimistic)
which has ...
1000 Set ss = New Recordset
1020 ss.Open sqlString, gCn, CursorType, LockType
And in that one instance ... line 1020 sometimes raises Error 5
It's not an error assembling the sql, as that is assembled before the call to the function. It doesn't appear to be an error in the SQL, as error 5 is a VB6 error, not a SQL Server error.
I can't have a Command object do the Execute for me here, as I need the recordset to be updateable. I know ... not the best data access model, but this has been working for a long time and is scheduled for a rewrite into .Net pretty soon, so an overhaul in VB6 doesn't appear worthwhile.
Has anyone else seen this before?
Any good ideas on resolving it?