Dim i as integer i = rs.RecordCount //i is set as -1
Please, read my comment to the question.
Here is an answer: RecordCount Property (ADO)[^]
MSDN wrote:The property returns -1 when ADO cannot determine the number of records or if the provider or cursor type does not support RecordCount.
-1
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)