472,143 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

recordCount incorrect for Distinct Clause in Quer

Gyanchand
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 1960
ck9663
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.