470,618 Members | 1,727 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,618 developers. It's quick & easy.

GROUP By clause or DISTINCT clause

Hi, can anyone shed some light on this issue?

SELECT Status from lupStatus
with a normal query it returns the correct recordcount

SELECT Status from lupStatus GROUP BY Status
but with a GROUP By clause or DISTINCT clause it return the recordcount
= -1

Jul 23 '05 #1
3 3862

Which application are you using? If it is VB then it shold be client
side cursor

Madhivanan

Jul 23 '05 #2
Madhivanan, thanks for your response, we are not using client side
cursor, but server side (the query work fine, adLockReadonly but it
doesn't work when we use adLockOptimistic) VB COM

Jul 23 '05 #3
Jacek (ja***************@gmail.com) writes:
Madhivanan, thanks for your response, we are not using client side
cursor, but server side (the query work fine, adLockReadonly but it
doesn't work when we use adLockOptimistic) VB COM


So the count we are talking about is Recordset.RecordCount?

What cursor type do you ask for? A query with GROUP BY or DISTINCT
can only result in a static or forward-only cursor, and it cannot
be updatable. A static cursor has a rowcount, a forward-only cursor
has not.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Randell D. | last post: by
3 posts views Thread by Robby McGehee | last post: by
2 posts views Thread by Jai | last post: by
2 posts views Thread by aj70000 | last post: by
5 posts views Thread by Amadelle | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.