469,072 Members | 1,816 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

recordCount incorrect for Distinct Clause in Quer

I have recently migrated DB from Sql Server 2000 to Sql Server 2005.
Ever since, when i fire queries with a DISTINCT clause, the recordcount property returns the result as -1.

I am using the record set as:
Sql ="Select dictinct fieldName from tbTableName"
rs.Open Sql,ObjConn,adOpenStatic,adLockPessimistic

However when i tried removing the Lock Type property from the recordset, it reurns the correct recordcount. Can anyone tell me why is this happening. Is there any setting that needs to be done in Sql Server 2005
Jan 6 '09 #1
1 1892
2,878 Expert 2GB
I think this is more of a VBA/ASP question than a sql server question. Try posting it to the Programming Forum and they might be able to help you more.

-- CK
Jan 6 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Martin Feuersteiner | last post: by
10 posts views Thread by Farmer | last post: by
1 post views Thread by qqmbers | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.