i am opening the rs like this Dim rstemp As New ADODB.Recordset rstemp.Open " Some query ", con, adOpenDynamic, adLockOptimistic If rstemp.EOF = False Then lngAfterInsertCnt = rstemp.RecordCount End If rstemp.Close rstemp.RecordCount is giving -1. WHAT COULD BE THE PROBLEM ?
Hi, here is descrption and resolution of the problem in the KB article on MSDN: [PRB: ADO: Recordcount May Return -1]. It states: > When you request the RecordCount for a > serverside recordset, a -1 may return. > This occurs with ActiveX Data Objects > (ADO) version 2.0 or later when the > CursorType is adOpenForwardonly or > adOpenDynamic. What is exactly your situation. :