We are receiving this error when adding records (see code below). The error occurs only occasionally. There are no changes being made to the database schema. The program is in vb6 with sql2008r2. This code runs on hundreds of other systems with no errors
(The error occurs at line 1090):
If DetRecs.state = adStateOpen Then Set DetRecs = Nothing
gDBCmd.CommandText = "Select * From TikDet Where 1 = 2 "
DetRecs.Open gDBCmd, , adOpenForwardOnly, adLockOptimistic
1000
For I = 1 To UBound(DetArray, 2)
1010 If DetArray(mitikctr, I, 1) = 0 Then Exit For
DetTotalUp = 0
With DetRecs
1020 .AddNew
!tikdetcomp = miComp
!TikDetStore = miStore
!TikDetTikNum = miTikNum(mitikctr)
1090 .Update