MGillanders


What are the best pratices on selecting single values from SQL Server tables (ADO) in VBA code in an Access Data Project

The command.execute method returns a ADODB.Recordset so a SQL SELECT statement can be executed and moving to the first record of the recordset to get the value.  But seems a little extreme to lookup one value.

The DLoookup methods used for Access tables (DAO) are not available for ADO.

In .NET there is a sqlcommand.executescalar which returns a single object.

What is the recommended method to select a single value from a SQL table