473,387 Members | 1,561 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 2017
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

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

Similar topics

5
by: Pat L | last post by:
I have a function that is designed to return a variable that contains concatenated values from a partinular field in the returned rows: DECLARE @output varchar(8000) SELECT @output = CASE...
5
by: Martin Feuersteiner | last post by:
Dear Group I'm having trouble with the clause below. I would like to select only records with a distinct TransactionDate but somehow it still lists duplicates. I need to select the...
1
by: Alex Satrapa | last post by:
I have a table from which I'm trying to extract certain information. For historical reasons, we archive every action on a particular thing ('thing' is identified, funnily enough, by 'id'). So the...
18
by: mathilda | last post by:
My boss has been adamant that SELECT DISTINCT is a faster query than SELECT all other factors being equal. I disagree. We are linking an Access front end to a SQL Server back end and normally are...
6
by: Bob Stearns | last post by:
I am getting unwanted duplicate rows in my result set, so I added the DISTINCT keyword to my outermost SELECT. My working query then returned the following message: DB2 SQL error: SQLCODE: -214,...
10
by: Farmer | last post by:
Hello Folks, can anybody tell me how to do the following very simple thing: I have a table that has say departments, divisions and units of an organisation and what i am trying to do is find a...
4
by: monomaniac21 | last post by:
hi! is it possible to do the aforementioned query - selecting only distinct in 1 col but retrieving all other cols at the same time. regards marc
2
by: smook | last post by:
I have some code in an ONCURRENT event that is running a query and then counting the number of records returned. However the RecordCount is always returning 1. I know the query works .. i put a...
1
by: qqmbers | last post by:
May be it will help someone. I faced the strange problem with RecordCount property of cloned Recordset within the Current event handler. The RecordCount value was correct every time I had...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.