BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ado query vs ado table filter

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (ADO)
View previous topic :: View next topic  
Author Message
basilis
Guest





PostPosted: Fri Dec 29, 2006 9:10 am    Post subject: ado query vs ado table filter Reply with quote



hi all

i want to view some specific data from a table in a database.there are 2
ways:
a)pass an sql query in an adoquery component and get the results
b)make a adotable that connects to the table of the database and then use
the filter property to get the specific results

is there any diffrence in the 2 ways?which one is faster?
should i use the second one if i need to make many queries in the same
table?

thks
Back to top
Mike Collins
Guest





PostPosted: Mon Jan 15, 2007 5:02 pm    Post subject: Re: ado query vs ado table filter Reply with quote



SQL is probably faster and has less overheads.

When you use a table, your application / ado requests ALL the data for that
table. That information is shipped from the database, via ado, to your
table within builder. Then you apply your filter in builder which iterates
thought all the data client-side (you app) and removes any entries that do
not match. This is ok but if you have thousands of records, it's a lot to
ship over unnecessarily. My impression of table filters where simply a
mechanic to provide GUI style filtering and ordering - not actually as a
selective function. As far as I remember, filters can be toggles on and off
so it makes it very useful for filtering as I have described.

SQL on the other, relies on the database / engine to do the hard work and
only returns the records that you actually want. However, SQL requests have
overheads as well. The database engine must compile the sql request and
execute it - this takes a finite about of time. This can be avoided by
using stored procedures.

Basically, it boils down to what exactly you are doing, how much data your
are detailing with, what type of database you are communicating with (local
Access/desktop database vs. sql server) and where you database is located or
accessed from.

HTH

"basilis" <billaras1234 (AT) hotmail (DOT) com> wrote in message
news:459487e5 (AT) newsgroups (DOT) borland.com...
Quote:
hi all

i want to view some specific data from a table in a database.there are 2
ways:
a)pass an sql query in an adoquery component and get the results
b)make a adotable that connects to the table of the database and then use
the filter property to get the specific results

is there any diffrence in the 2 ways?which one is faster?
should i use the second one if i need to make many queries in the same
table?

thks
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.