Board index » delphi » Newbie Question on ADO.

Newbie Question on ADO.

Hello,

Hopefully some simple questions someone can answer for me.

We're currently using Delphi 4.0 C/S. We have a large app that uses
the BDE to run again either Interbase, MS SQL, or Oracle. The
entire app uses TQuerys that all reference a single TDatabase
object.

We're planning on making the jump to ADO to try to avoid using
the BDE. Although it works fine, we'd like to avoid installing it
since some clients see this as some great "evil" that invades their
workstations.

My questions:

1) What is necessary in replacing the TDatabase -> TQuery
-> TDataSourse with ADO access? Can we just replace the
TDatabase, or do we need to replace all the TQuery's also?
If so, is there any way to automate this?

2) Does Interbase support ADO? If not, is there an easy way
to switch between an ADO data source and a BDE one. (I.e.
if the DBE is install everything use BDE, else everything use
ADO?)

3) What is performance like? I've heard mixed reviews on the
BDE, but I've found it light-and-day ahead of ODBC. On ADO
I've also heard mixed reviews.

4) Can you still access ODBC data sources without the BDE
installed, or do you need 3rd-party software?

5) Can you still access dBase files or do you have to use
ADO or ODBC?

Thanks,

Brett

 

Re:Newbie Question on ADO.


Quote
> 1) What is necessary in replacing the TDatabase -> TQuery
> -> TDataSourse with ADO access? Can we just replace the
> TDatabase, or do we need to replace all the TQuery's also?
> If so, is there any way to automate this?

You'll need to replace the TDatabase with a TADOConnection and all of the
TQuery components with TADOQuery components.  It's not hard to do by hand
(search and replace in the PAS and DFM files).  You can also use GExperts
which has a component search and replace feature.

Quote
> 2) Does Interbase support ADO? If not, is there an easy way
> to switch between an ADO data source and a BDE one. (I.e.
> if the DBE is install everything use BDE, else everything use
> ADO?)

Interbase does not have an OLE DB provider yet (as far as I know) so you'd
have to go ADO -> ODBC -> Interbase.  I wouldn't try to write a mixed
BDE/ADO application although it's certainly possible.  Also, keep in mind
that a lot of people who don't like the idea of installing ADO probably
already have it.  Windows 2000 includes ADO an if you've installed anything
from Microsoft lately you probably have it.

Quote
> 3) What is performance like? I've heard mixed reviews on the
> BDE, but I've found it light-and-day ahead of ODBC. On ADO
> I've also heard mixed reviews.

Some people think ADO is way faster, some think it's way slower.  Because of
the way you've written your application it should be fairly easy to just
convert to ADO and see what you think.

Quote
> 4) Can you still access ODBC data sources without the BDE
> installed, or do you need 3rd-party software?

Yes.  ADO supports ODBC connections.

Quote
> 5) Can you still access dBase files or do you have to use
> ADO or ODBC?

For dBase and Paradox you pretty much still need the BDE (I've never used
either so I'm not sure).

-Mike

Re:Newbie Question on ADO.


To add to what Mike has already said....

Instead of using TADOQuery or TADOStoredProc, I highly recommend spending a
few extra days and get familiar with TADODataSet.  There are limitations
with the Query and Stored Procedure components (no way to set the command
timeout), not to mention they are much slower.

Brandon Lilly
--
Remove "no_spam" from address to email directly

Re:Newbie Question on ADO.


Mike and Brandon,

Thanks for your responses. I don't think it will be as much
work as I originally thought.

Not having IB is a bit of an issue, but otherwise at least I
know it isn't a unbelievable amount of work.

I'm sure I'll get into the nitty-gritty details when we finally
make the decision, but this is still likely months away. Not
having Delphi 5, one quick question, if I may:

Quote
>Instead of using TADOQuery or TADOStoredProc, I highly recommend spending a
>few extra days and get familiar with TADODataSet.  There are limitations
>with the Query and Stored Procedure components (no way to set the command
>timeout), not to mention they are much slower

What's the difference between TADOQuery and TADODataSet? (I have about
3,000 references to TQuery objects in the app!)

We don't use any stored procs (too many differences in IB, MS SQL,
and Oracle).

Thanks again,

Brett

Re:Newbie Question on ADO.


Quote
"Brett Watters" <bwatt...@geometrix.bc.ca> wrote in message

news:8liddq$7k13@bornews.borland.com...

Quote
> What's the difference between TADOQuery and TADODataSet? (I have about
> 3,000 references to TQuery objects in the app!)

Hi Brett,

Both are TADOCustomDataSet descendents, but TADOQuery is only usable for
queries [natch], where TADODataSet can be used for anything that returns a
recordset.  The only real problem (other than overhead that slows down your
application), is that it has a "hard-coded" command timeout of 30 seconds.
For many, this is acceptable, but we have many queries that can last
anywhere from a couple seconds to several hours (for data intensive
reports).  TADOQuery would always time out before our operations were
complete, and it was due to the hard-coded command timeout.  By using
TADODataSet, you can control the length of the timeout.  The only reason
TADOQuery and TADOStoredProc were included, was to give those that were
moving over from the BDE a break by giving them components they were already
familiar with.

I really suggest spending some extra time and getting to know TADOCommand
and TADODataSet.  You will undoubtedly have to use them anyways (trust me).

Brandon Lilly
--
Remove "no_spam" from address to email directly

Other Threads