Re: Problems querying DB2 through ADO



Thanks, but that temp job finished weeks ago.

(Actually, we gave up on ADO and switched over to the IBM DB2.Net data
provider which does give an accurate Count, although that was not the main
reason we used it.)

"Matt Neerincx [MSFT]" wrote:

> In general, you cannot count on an accurate recordcount from any driver. It
> is good to avoid this.
>
> The reason for this is most database systems just shove over the data
> directly from the query engine and don't count the rows as they do this. In
> ADO you can use adUseClient cursor and it will cursor the records on the
> client side an provide recordcount for you, but the price for this is caching
> every single byte of your result in memory on the client side so be careful
> you can get burned if you have a big resultset.
>
>
>
> "B. Chernick" wrote:
>
> > Forget the part about the recordcount. I've been obsessing about it because
> > it's in my debug messages but it really isn't that important to flow control.
> >
> > "B. Chernick" wrote:
> >
> > > Actually the nature of the problem may have changed. The DB2 installation is
> > > at the other end of the country so I have to guess long-distance what they
> > > have.
> > >
> > > What I'm wondering about now is whether or not I can rely on the recordcount
> > > property of the result set. I've been looking at the MSDN library and I see
> > > that it may not always work. Unfortunately my code relies entirely on it.
> > > I'm going to try some of the code samples in the library, unless you can
> > > suggest something better.
> > >
> > > Thanks.
> > >
> > > "Matt Neerincx [MSFT]" wrote:
> > >
> > > > DB2 and ODBC have been around for a long long time. So it's all pretty well
> > > > figured out by now.
> > > > Install the DB2 driver, configure the DB2 driver to use your DB2 database
> > > > and it just works. There are various vendors that will sell you DB2 drivers
> > > > like Data Direct, etc..., IBM also makes one of course, any one will pretty
> > > > much do. You will want to check the version of DB2 you have on the back end
> > > > and insure that the driver you use supports the DB2 version.
> > > >
> > > > --
> > > > Matt Neerincx [MSFT]
> > > >
> > > > This posting is provided "AS IS", with no warranties, and confers no rights.
> > > >
> > > > Please do not send email directly to this alias. This alias is for newsgroup
> > > > purposes only.
> > > >
> > > > "B. Chernick" <BChernick@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > > > news:D201DCD1-80E6-4E4B-9BA1-2D50B6DC4BA5@xxxxxxxxxxxxxxxx
> > > > > Thanks! Looks like there's some other things on your site worth reviewing
> > > > > as
> > > > > well.
> > > > >
> > > > > Any 'twitches' in the ODBC-DB2 connection itself?
> > > > >
> > > > > "Matt Neerincx [MSFT]" wrote:
> > > > >
> > > > >> The underlying DB2 driver you use actually implements the SQL syntax, not
> > > > >> ADO or VB.NET.
> > > > >> If you are using an ODBC driver you can use the ODBC canonical join
> > > > >> syntax
> > > > >> to be more generic across multiple drivers, see for example:
> > > > >>
> > > > >> http://www.canaimasoft.com/f90sql/OnlineManual/Chapter03/Outer%20joins%20scape%20sequence.htm
> > > > >>
> > > > >>
> > > > >> --
> > > > >> Matt Neerincx [MSFT]
> > > > >>
> > > > >> This posting is provided "AS IS", with no warranties, and confers no
> > > > >> rights.
> > > > >>
> > > > >> Please do not send email directly to this alias. This alias is for
> > > > >> newsgroup
> > > > >> purposes only.
> > > > >>
> > > > >> "B. Chernick" <BChernick@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > > > >> news:DCE70540-1EDD-4390-B266-2B364B88EB0C@xxxxxxxxxxxxxxxx
> > > > >> > I'm trying to write an application in VB.Net 1.1 using the ADODB lib to
> > > > >> > access DB2 databases. The application will be running on a Windows
> > > > >> > 2003
> > > > >> > server. (That's what the client wants.)
> > > > >> >
> > > > >> > For lack of any better way to put it, are there any major 'GOTCHAS'
> > > > >> > when
> > > > >> > doing this sort of connection, especially regarding SQL syntax? I
> > > > >> > think I
> > > > >> > write fairly generic code but in this case I'm really beginning to
> > > > >> > wonder.
> > > > >> > One Join query works perfectly. Another I cannot get to work at all.
> > > > >> >
> > > > >> > All the code is read-only. All I'm doing in every case is generating a
> > > > >> > small resultset.
> > > > >> >
> > > > >>
> > > > >>
> > > > >>
> > > >
> > > >
> > > >
.



Relevant Pages

  • ADO Function Needed
    ... I seem to repeat the same ADO call because the ... .RecordCount is dynamic, even though the actual SQL is the same. ... to create a function that executes the query, opens the recordset, then ...
    (microsoft.public.data.ado)
  • Re: AbsolutePosition Problem
    ... > It sounds like you are still using ADO Recordsets, ... > DataTables and DataSets, right? ... > AbsolutePosition and RecordCount were never recommended for reliable ... > you are recieving -1 for AbsolutePosition, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: VB6 & SQL2000 Stored Proc problem
    ... Consider that COM-based ADO returns control to the application BEFORE rowset population is complete for some cursors. ... See "ADO and ADO.NET Examples and Best Practices " or "Hitchhiker's Guide to Visual Basic and SQL Server " for details--and suggestions about why it's not a good idea to use SELECT *. ... Are you assuming theres' too many records based on the return from .RecordCount? ...
    (microsoft.public.vb.database.ado)
  • Re: AbsolutePosition Problem
    ... > opening to get an accurate recordcount. ... >> It sounds like you are still using ADO Recordsets, ... >> you are recieving -1 for AbsolutePosition, ... >> You should consider using ADO .NET and loading your data into DataTables ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Problems querying DB2 through ADO
    ... you cannot count on an accurate recordcount from any driver. ... client side an provide recordcount for you, but the price for this is caching ... Unfortunately my code relies entirely on it. ... >>> Please do not send email directly to this alias. ...
    (microsoft.public.data.ado)