recordCount incorrect for Distinct Clause in Quer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gyanchand
    New Member
    • Jul 2007
    • 35

    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,adO penStatic,adLoc kPessimistic

    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
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    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

    Comment

    Working...