When I run a query that contains SELECT DISTINCT or GROUP BY, the RecordCount displays as -1 when using the code below. If SELECT DISTINCT or GROUP BY are not used in the query, then the RecordCount displays the correct number.
Set myRs = New ADODB.Recordset
With myRs
.ActiveConnection = cn
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open (sSQL)
.RecordCount
End With
Any ideas what the cause or solution might be?
Thanks.....Franco
Set myRs = New ADODB.Recordset
With myRs
.ActiveConnection = cn
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open (sSQL)
.RecordCount
End With
Any ideas what the cause or solution might be?
Thanks.....Franco