I am using VB6 with Access 2003. I must of done something because all of a sudden I cannot add a record and cancel it without causing an error. Here is my code:

strCnn = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=myMDB.mdb"


cnn1.Open strCnn

Set adoPrimaryRS = New Recordset

adoPrimaryRS.CursorLocation = adUseServer

strPrimarySQL = "select casename,renldate,product,fundingcode, * from Client " & " order by casename, renldate, product, fundingcode"
adoPrimaryRS.Open strPrimarySQL, cnn1, adOpenStatic, adLockOptimistic


When I want to add a record:

With adoPrimaryRS
If Not (.BOF Or .EOF Or .RecordCount = 0) Then
mvBookMark = .Bookmark
Else
mvBookMark = 0
End If
.AddNew
End With

I cancel a record by:


adoPrimaryRS.CancelUpdate
If adoPrimaryRS.RecordCount = 0 Then
AddFirstRecord
Else
If mvBookMark > 0 Then
adoPrimaryRS.Bookmark = mvBookMark
Else
adoPrimaryRS.MoveFirst
End If
End If

If I then go to a previous record I get an "Operation Canceled" error message on the moveprevious statement.

If Not adoPrimaryRS.BOF Then
adoPrimaryRS.MovePrevious
End If

If adoPrimaryRS.BOF And adoPrimaryRS.RecordCount > 0 Then
Beep
'moved off the end so go back
adoPrimaryRS.MoveFirst
end if

This makes no sense to me because it was working fine 2 weeks ago. I reinstalled MDAC_TYP,EXE. What would cause this to happen. I also repaired the database several times without any success. It seems like a corrupted file someplace but for the life of me I can't figure out which one.