"Dan" <(E-Mail Removed)> wrote in message
news:92770EDA-7F95-4377-9552-(E-Mail Removed)...
> Is there a property that count the result of an SQL query.
> I could find one that count the number of fields, but not the number of
> results.
>
> Is there another way to find out if an SQL return any result or no result
> are returned.
Dim strSQL As String
Dim rcsCheck As New ADODB.Recordset
Dim intNumberOfRecords As Integer
'
strSQL = "Your Query"
rcsCheck.Open strSQL, "Provider=MSDASQL;DSN=YourDSN", adOpenStatic,
adLockOptimistic
intNumberOfRecords = rcsCheck.RecordCount
I tried a few things but this only seems to work for adOpenStatic,
adLockOptimistic
hth
Gys
|