Just had a look through some of the MS Docs for ADO. When you run the Execute() method on a connection object, you return a recordset with only limited functionality.

You would be better off creating a recordset object first, running your SQL query without the COUNT function embedded, to simply return the results to the recordset object, then using the RecordCount() method to get an integer value representing the number of records. Here's an example from a script I wrote to write logon data to an Access database.

code:
$DATABASE = "\\corpfs01\rollout$$\logon.mdb"
$DSN="Driver={Microsoft Access Driver (*.mdb)}; DBQ=$DATABASE"

;Create SQL statements to check/write/update database
$CHECK_ENTRY_USERS = "SELECT * FROM TBL_USERS WHERE USERNAME='@USERID';"
$CHECK_ENTRY_COMPUTERS = "SELECT * FROM TBL_COMPUTERS WHERE WORKSTATION='@WKSTA';"

$Connection = CreateObject("ADODB.Connection")
$Command = CreateObject("ADODB.Command")
$Recordset = CreateObject("ADODB.Recordset")

;Check for connection object
if $Connection

;Open connection to database
$Connection.ConnectionString = $DSN
$Connection.Open()

;Check for existing records for the current workstation/user
;Add new record or update existing as required

;Check for User details first
$Command.ActiveConnection = $Connection
$Recordset.CursorType = 3
$Recordset.LockType = 3
$Recordset.ActiveCommand = $Command
$Command.CommandText = $CHECK_ENTRY_USERS
$Recordset.Open($Command)

;Create new record if none exists to update
If $Recordset.RecordCount < 1
$Recordset.AddNew
Endif



You can see how to create the recordset that will allow you to use the RecordCount() method here.

MS documentation on ADO can be found here with examples in VB and VBS for nearly all methods and properties.

HTH

_________________________
================================================
Breaker