Re: CCommand::Open inconsistency across providers
Vagif Abilov <[email protected]> Fri, 2 Aug 2002 12:55:12 +0200
| Newsgroups | gmane.comp.windows.devel.oledb.devel |
|---|---|
| Message-ID | <[email protected]> |
Again, it should not be called "inconsistency". There's nothing wrong with returning -1 or returning actual number of rows. Both are correct and documented in OLE DB specs. Unfortunately many developers are used to desktop databases where number of rows can be either returned directly or easily computed. In a real world the number of query results is usually not known unless you go and count them, and if the query is "SELECT * FROM AllPeople", then this is not the best thing to do. .................................. Vagif Abilov -----Original Message----- From: OLEDB_DEV [mailto:[email protected]]On Behalf Of Kim Gräsman Sent: 2. august 2002 09:10 To: [email protected] Subject: Re: [OLEDB_DEV] CCommand::Open inconsistency across providers Vagif & Alex, I've decided to never depend on it, since the SQL Server provider doesn't return record counts. If there are inconsistencies in between providers, that sounds like another reason to leave it a dummy parameter. // kim > -----Original Message----- > From: Vagif Abilov [mailto:[email protected]] > Sent: den 2 augusti 2002 08:04 > To: [email protected] > Subject: Re: CCommand::Open inconsistency across providers > > > It's a long time since I was using Jet. AFAIK Jet supports > record count, > i.e. it never returns "-1". In principle value "0" should > mean that there > are no records in the result list. > > > .................................. > Vagif Abilov > > > > > -----Original Message----- > From: OLEDB_DEV [mailto:[email protected]]On > Behalf Of Alex > Ivanoff > Sent: 2. august 2002 06:10 > To: [email protected] > Subject: Re: [OLEDB_DEV] CCommand::Open inconsistency across providers > > > You right, -1 means the numbre of affected rows is > unavailable. But why > Jet provider returns 0? Should it not return -1 as well? > > > -----Original Message----- > From: OLEDB_DEV [mailto:[email protected]] On Behalf Of > Vagif Abilov > Sent: Thursday, August 01, 2002 20:14 > To: [email protected] > Subject: Re: [OLEDB_DEV] CCommand::Open inconsistency across providers > > > There is nothing inconsistent in it. I don't have OLE DB specs with me > now, but as far as I remember, if you get -1, it means that number of > affected rows is unavailable, while any non-negative number > means actual > counter value. > > Bear in mind that most of SQL databases have no way of SELECT > result set > size calculation other than just count all rows, so they don't do it > unless you ask (for example by execution SELECT COUNT(*) statement). > > Hope this helps > > Vagif Abilov > [email protected] > > ----- Original Message ----- > From: "Alex Ivanoff" <[email protected]> > To: <[email protected]> > Sent: Friday, August 02, 2002 12:48 AM > Subject: [OLEDB_DEV] CCommand::Open inconsistency across providers > > > > When I call CCommand::Open(session, L"SELECT * from Table", propSet, > > pRowsAffected) with SQLOLEDB, pRowsAffected is set to -1. > When I make > > this very call with Microsoft Jet 4.0 provider, pRowsAffected is set > > to 0. Is there a way to get consistent behavior? > > > > You can read messages from the OLEDB_DEV archive, unsubscribe from > OLEDB_DEV, > > or subscribe to other DevelopMentor lists at > > http://discuss.develop.com. > > > > > > You can read messages from the OLEDB_DEV archive, unsubscribe from > OLEDB_DEV, or subscribe to other DevelopMentor lists at > http://discuss.develop.com. > > You can read messages from the OLEDB_DEV archive, unsubscribe from > OLEDB_DEV, > or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV, or subscribe to other DevelopMentor lists at http://discuss.develop.com.