Hi.
Code:
Dim sTotal As String
Dim rsCount As ADODB.Recordset
'This line of error 91 "to the object variable or With block variable not set
rsCount.Open "Select Count(Bairro) from [Registros$] where Bairro = 'Centro'"
msgbox "O Total de Regsitros é " & rst(0)
sTotal = "Select Count(Bairro) from [Registros$] where Bairro = 'Centro'"
msgbox "O Total de Regsitros é " & sTotal