Again, this use of RecordCount requires the use of an expensive cursor type.
Use the EOF property instead (as Aaron correctly suggested):
'//immediately after opening the recordset:
If not rst.EOF then
'//recordset is not empty
else
'//recordset is empty
end if
Bob Barrows
Steven Burn wrote:
> I actually generally use;
>
> If rst.RecordCount > 0 then
> '// Something
> End If
>
> Just figured I'd be creative
\
>
>
> "Aaron [SQL Server MVP]" <> wrote in message
> news:#...
>>> valTemp = rst.RecordCount
>>> Select Case valTemp
>>> Case 0
>>> Response.Redirect "nothing_in_there.asp"
>>> Case Else
>>> Response.Redirect "something_in_there.asp"
>>> End Select
>>
>> Except, RecordCount isn't available with the default cursor (-1 is
>> the default), so your Else will probably always fire.
>>
>> The EOF property will tell you if the resultset is empty without
>> having to rely on a count.
>>
>> A
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"