D2 Newbie Q: Filtering a Database 
Author Message
 D2 Newbie Q: Filtering a Database

Hi all,

This is bit of a continuing saga since I'm still very new Delphi. But
many thanks again for the many who assisted with the previous questions.

There are 3 more questions relating to Filtering:

1. What is the syntax for filtering on a TDBCheckbox? I have Speed Button
called sbBusiness. The Paradox database table name is taINTERNET, which
has a field "_BusInd".

 if sbBusiness.down then begin
   with dmCONSULT.taINTERNET do begin
     Filter := '_BusInd.Checked = True';
     Filtered := True;
 else begin
   with dmCONSULT.taINTERNET do begin
     Filtered := False;

I get an error: "Invalid filter expression character: '.''.

Any ideas?

2. Is it possible for a filter to limit in addition to a previous
selection. ie. I have a group of buttons that select Web Sites or FTP
Sites. This is done using Filter and Speed buttons. I will have another
pair of buttons that select Business or Personal. If the Web Site and
Business buttons are pressed together: It should just show Business Web
Sites. Do I need to code nested ifs to do this? Any suggestions as to how
to code this?

3. Finally, I want text box filter that limits the DBGrid to show just
items which contain the entered text. On the form there is a check box
called ckFilterToggle and a edit box called edFilterText. The text should
be compared with the database field "Descrip".

I have this coded within the form:

 procedure TfmCNETBED0.ckFilterToggleClick(Sender: TObject);
   dmCONSULT.taINTERNET.Filtered := ckFilterToggle.Checked;

 procedure TfmCNETBED0.edFilterTextChange(Sender: TObject);
   ckFilterToggle.Checked := True;
   dmCONSULT.taINTERNET.Filtered := True;

and within the Data Module an OnFilterRecord Event for the table
taINTERNET which reads:

 procedure TdmConsult.taINTERNETFilterRecord(DataSet: TDataSet;
   var Accept: Boolean);
   Accept := Dataset['Descrip'].Value = fmCNETBED0.edFilterText.Text;

I get an Error message: "Variant method calls not supported" on

Once again, I'm dumbfounded.

Many thanks in advance to anyone who responds to any of the questions.


      _____  __  __________  ????????????????????????????????????????????

 /  \     /    \ |_  |_ |_ | I.T. Contractor        
/    \___/ _____)|_________| SAP Systems Specialist Brisbane,   AUSTRALIA
    SAP Resource Centre   http://www.*-*-*.com/ ~adbell/saprectr.html

Fri, 12 Feb 1999 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Newbie Looking for info on D2 Database development

2. Database link'n'joining Qs

3. No Current Record with Filter in D2

4. D2: BDE memory leak using filters on TTable

5. Filter Bug with Append in D2?

6. How to filter on blank fields in D2?

7. File Filtering Info request - newbie help

8. Newbie Question: Filtering on date?

9. qs?.mb files and lost data

10. D2 -> Clipper with same database

11. Moving a database app from D1 To D2

12. Deployment of Database from D2


Powered by phpBB® Forum Software