Re: filer table by a word ....

From: sew crazy (sew.crazy_at_webmail.co.za)
Date: 03/20/05


Date: Sun, 20 Mar 2005 08:56:09 +0200

On Sat, 19 Mar 2005 13:00:05 GMT, Jeremy Collins
<jd.collins@ntlworld-not.com> wrote:

>sew crazy wrote:
>> begin
>> sDate := MonthCalendar1.Date;
>> adotable1.Filter := '(distance > 300)';
>> adotable1.Filter := '(type of transport = (spoor))';
>> // i want to filer a word in a colum
>> // the first filter works not the second ....
>>
>> adotable1.Filtered := True;
>> end;
>
>Filters follow the same rules as the SQL variant of the underlying
>DBMS; I'm not aware of any that handle strings like your approach.
>
>ADOTable1.Filter := '(type of transport = ''spoor''');
>
>It's not terribly good practice to have spaces in field names, and
>also TADOTable is only provided for backwards compatibility with BDE-
>based components. You should really be using TADODataset or TADOQuery.
>
>With a TADOQuery you can use SQL to return only the data you need,
>i.e. 'SELECT * FROM tb_mytable WHERE TypeOfTransport = ''spoor'''

got it THANX :)
ADOTable1.Filter := '(typeoftransport = ''spoor'')';

Changed the field names like you sugested .. was actually a lot of
work having to rebuild most of the links ... :-p but was worth it
busy setting a question for students - have to make use of their field
of reference .. sql is minor @ this stage ,,,
Regards ...



Relevant Pages

  • Re: Truncated Blob Field in TADOQuery
    ... I used a TADOStoredProc instead and the problem went away. ... suspect that ti has to do with the manner in which TADOQuery handles ... and pumping it down into a MS SQL db locally. ... > of the parameter in the TADOQuery component before calling the ExecSQL ...
    (borland.public.delphi.database.ado)
  • Re: MSAccess and ADO
    ... database I use TADOQuery and SQL ... Stanko. ...
    (borland.public.delphi.database.ado)
  • Re: Which is faster??
    ... SQL inserts will always run faster that opening an entire table and posting. ... If you are using MS Access, TADOQuery should be faster, but not by much. ... using TADOTable components and essentially the code looks like this... ... change to INSERT and UPDATE SQL queries be faster?? ...
    (borland.public.delphi.database.ado)
  • Re: the dbgrid will be uneditable
    ... only sqlserver tables and the program running in delphi can generate that ... >>if using tadoquery and sql to join two tables,the dbgrid will be ...
    (borland.public.delphi.database.ado)
  • Getting Parameters at runtime
    ... I have a TADOQuery and I'm setting the SQL at runtime with parameters (i.e. ... :ParamName is in the text). ... I would like the Parameters list to populate ...
    (borland.public.delphi.database.ado)