🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
2 messages
2 total messages Started by basilis Fri, 29 Dec 2006 03:14
ado query vs ado table filter
#238
Author: basilis
Date: Fri, 29 Dec 2006 03:14
13 lines
1269 bytes
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 
Re: ado query vs ado table filter
#245
Author: Mike Collins
Date: Mon, 15 Jan 2007 11:02
41 lines
2912 bytes
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@hotmail.com> wrote in message 
news:459487e5@newsgroups.borland.com...
> 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
> 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads