Solved

DB Filtering BLOB (RTF) Fields

Posted on 2004-04-14
4
311 Views
Last Modified: 2010-04-05
I have a Pardox database and I use TQuery to join tables. In TQuery I have BLOB field (with RTF document). I need to filter my database by this BLOB field. I tried with QueryFilterRecord(aDataSet: TDataSet; var Accept: Boolean) event. When I need to access to BLOB field I get this message:
---------------------------
Debugger Exception Notification
---------------------------
Project KatalogZapisa.exe raised exception class EDatabaseError with message 'Query: Cannot access field 'Sadrzaj' in a filter'. Process stopped. Use Step or Run to continue.
---------------------------
OK   Help  
---------------------------
But when I access another field which isn't BLOB field, everything is OK.

My code looks like this:
 
procedure TData.QueryFilterRecord(aDataSet: TDataSet; var Accept: Boolean); var
  s: TStream;
begin
        s := TStream.Create;
        try
            s := aDataSet.CreateBlobStream(aDataSet.FindField('Sadrzaj'), bmRead);
            MainForm.Re.Clear;
            MainForm.Re.Line.LoadFromStram(s);
            Accept := MainForm.Re.FindText(FindWhat, 0, Length(MainForm.re.Text), []) <> -1;
        finally
            s.Free;
        end;
end;
 
Can anybody help me?
0
Comment
Question by:Grmek
4 Comments
 
LVL 22

Accepted Solution

by:
Ferruccio Accalai earned 500 total points
Comment Utility
Sorry, but Blob filtering is not allowed....
from Paradox help:

Filters are similar to queries. Most of the operators that work in a query can also be used in a filter. The differences in the kinds of expressions you can use are

The @ wildcard operator is not allowed in a filter.
      The .. wildcard operator is not allowed in numeric or date fields in filters. Furthermore, this operator is allowed after the filter condition, but not before it. For example, you can type view.. to filter for all values that contain the letters "view" (either upper or lower case) followed by any other letters. This filter returns the values View, Viewing, viewed, viewable, and so on. Using the .. wildcard is the only way to define a case-insensitive filter.

Example elements are not used in filters. However, you can refer to one field from another. See Either/or conditions for more information.
      Calculated fields are not used in filters. Furthermore, math operations can be performed only on SQL tables.
--->!!!      You cannot use BLOB fields in filters, or filters in BLOB fields.   !!!<------
      Summary expressions (like COUNT>5) are not allowed in filters.
      In filters, parentheses can be used to nest conditions.

The comma functions as the AND operator for top-level conditions such as >200, <300. However, in a filter, the AND operator must be used instead of a comma to express more complicated conditions such as (>100 AND <200) OR (>300 AND <500). The general rule is that you must use AND when the condition is within parentheses.
      The LIKE, AS, and SET operators are not used in filters, but the TODAY and BLANK operators are allowed.
      Any operators that change data do not function in filters.

Checks are not used in filters, and records are displayed as if a CheckPlus is set on every field.
      Although filters cannot have multiple lines such as those used in queries, the equivalent to multiple lines is the OR keyword.
      The % (equivalent to mod) operator is supported in filters but not in queries. This operator only works on SQL tables.
      The operator precedence is slightly different than queries. See Operator precedence in filters for more information.

In all other respects, the types of expressions you can use in filters are the same as those used in queries. See About queries for more information on query expressions.

Live query views

You can use a query to return a data set that you can edit. The edits you make to this live query view are also made to the table you queried.
See About live query views for information on live query views.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now