We have an application with .Net 4.7 as WebAPI and some of the crital business logic is in VB6-COM.
ADODB interop DLL is used to pass recordset to COM object to perform further business logic.
Using SQL Server 2012R2.
Below is C# code
Recordset recordSet;
recordSet = metaData.GetMetadata();
....
....
//This method adds two rows in iteration
FillDefaultTwoRows(recordSet);
// COM object processes the recordset and this error out with EOF BOF
// even after having minimum one row in it.
dataManager.Process(recordSet);
Before making call to dataManager.Process(recordSet); if we call recordSet.MoveFirst() application do not error out with EOF and BOF is true exception else it always throw the EOF BOF is true.
The surprise is, exception comes only one machine out of seven, we check .net version, windows update, worker pool setting in IIS all are same. Connection string remains same for both machines, ADODB, ADO and VBVM versions are all same.
Same code deployed in two machines and here is the log from each
Machine A: Received ADODB.Recordset has BOF=False and EOF=False
Machine B: Received ADODB.Recordset has BOF=False and EOF=True
Machine-B is facing exception and machine A is not.
The biggest question we have what makes this record position reset?
Is there any system level/global config or setting needed to resolve this exception without code change?