<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'DBGrid - Table Filter Problem' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'DBGrid - Table Filter Problem' posted on the 'C++ Builder' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2009 Programmers Heaven</copyright>
    <pubDate>Sat, 21 Nov 2009 11:59:34 -0700</pubDate>
    <lastBuildDate>Sat, 21 Nov 2009 11:59:34 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>DBGrid - Table Filter Problem</title>
      <link>http://www.programmersheaven.com/mb/bcbuilder/389487/389487/dbgrid---table-filter-problem/</link>
      <description>Hi everyone,&lt;br /&gt;
I am a newbie both on this forum and Borland C++ and hope you can help me to figure out the problems which I encountered during my project.&lt;br /&gt;
&lt;br /&gt;
Here we go,&lt;br /&gt;
I wrote a program that reads SysLog messages and store it in a database.These log messages are highlighted to the user by means of DBGrid, Datasource and Table controls. &lt;br /&gt;
&lt;br /&gt;
My aim is &lt;em&gt;to write a filter for the table dataset&lt;/em&gt; which searches the log messages and only shows the entries which include this keyword.To make myself clear,suppose that our keyword is "whitepearl" and we want to show only the entries in DB that includes this keyword(3rd and 5th one)&lt;br /&gt;
&lt;br /&gt;
I tried to use "&lt;strong&gt; LOG = '*%s*' "&lt;/strong&gt; as a table filter expression with two wildcards but it didn't worked.What am I doing wrong?&lt;br /&gt;
&lt;br /&gt;
         &lt;span style="text-decoration: underline;"&gt;LOG&lt;/span&gt;&lt;br /&gt;
1)ZepyhR sent a message to Cedric.&lt;br /&gt;
2)System alert on #2334&lt;br /&gt;
3)Logging to the &lt;strong&gt;whitepearl&lt;/strong&gt;&lt;br /&gt;
4)Retrieval of the tuple id&lt;br /&gt;
5)OK from &lt;strong&gt;whitepearl&lt;/strong&gt;&lt;br /&gt;
6)Hangout by sender&lt;br /&gt;
&lt;br /&gt;
Note: Borland Builder v.5 is used</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/bcbuilder/389487/389487/dbgrid---table-filter-problem/</guid>
      <pubDate>Mon, 20 Apr 2009 02:41:50 -0700</pubDate>
      <category>C++ Builder</category>
    </item>
    <item>
      <title>Re: DBGrid - Table Filter Problem</title>
      <link>http://www.programmersheaven.com/mb/bcbuilder/389487/389887/re-dbgrid---table-filter-problem/#389887</link>
      <description>This is how i search a database and put the items in a grid, It might be longer then somes but it work great :D  Dont mind the money part it was there for adding values in hte database for each item that was found.  If you have any questions ask cheers squills&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt; 
void __fastcall TForm6::FormShow(TObject *Sender)
{
int i = 1;
int p = 0;
int money =0;
Edit3-&amp;gt;Text = Form1-&amp;gt;ExistingVehicleList-&amp;gt;Text; //This is what iam searching what ever is in that textbox
Table1-&amp;gt;First(); //starts at top of DAtabase
        do
        {       if(Table1-&amp;gt;Fields-&amp;gt;Fields[4]-&amp;gt;AsString == Edit3-&amp;gt;Text)//if the text(searched item) = the item in field 4 which is my list of items name
                {
                StringGrid1-&amp;gt;Rows[0]-&amp;gt;CommaText = "ProPM Item_Repaired Descreption Cost Date";
                StringGrid1-&amp;gt;RowCount = i +1;
//All this stuff inputs the info into the cells on the table from the database as long as field 4 is equeal to my search text
                StringGrid1-&amp;gt;Cells[1][i] = Table1-&amp;gt;Fields-&amp;gt;Fields[0]-&amp;gt;AsString;
                StringGrid1-&amp;gt;Cells[2][i] = Table1-&amp;gt;Fields-&amp;gt;Fields[1]-&amp;gt;AsString;
                StringGrid1-&amp;gt;Cells[3][i] = Table1-&amp;gt;Fields-&amp;gt;Fields[2]-&amp;gt;AsInteger;
                StringGrid1-&amp;gt;Cells[4][i] = Table1-&amp;gt;Fields-&amp;gt;Fields[3]-&amp;gt;AsString;
                 i=i+1;
                 money = money + Table1-&amp;gt;Fields-&amp;gt;Fields[2]-&amp;gt;AsInteger;
                 p = 1;
                 }
                 Table1-&amp;gt;Next(); //goes to the next database field
        } while(Table1-&amp;gt;Eof == false) ; //searches database till it the end of hte database
        if(p == 0)
           StringGrid1-&amp;gt;RowCount = 0;
           
        Edit1-&amp;gt;Text = StringGrid1-&amp;gt;RowCount - 1;
        Edit2-&amp;gt;Text = money;

DBNavigator-&amp;gt;BtnClick(nbInsert);

}
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/bcbuilder/389487/389887/re-dbgrid---table-filter-problem/#389887</guid>
      <pubDate>Sun, 26 Apr 2009 20:14:30 -0700</pubDate>
      <category>C++ Builder</category>
    </item>
    <item>
      <title>Re: DBGrid - Table Filter Problem</title>
      <link>http://www.programmersheaven.com/mb/bcbuilder/389487/389888/re-dbgrid---table-filter-problem/#389888</link>
      <description>This is how i search a database and put the items in a grid, It might be longer then somes but it work great :D  Dont mind the money part it was there for adding values in hte database for each item that was found.  If you have any questions ask cheers squills&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt; 
void __fastcall TForm6::FormShow(TObject *Sender)
{
int i = 1;
int p = 0;
int money =0;
Edit3-&amp;gt;Text = Form1-&amp;gt;ExistingVehicleList-&amp;gt;Text; //This is what iam searching what ever is in that textbox
Table1-&amp;gt;First(); //starts at top of DAtabase
        do
        {       if(Table1-&amp;gt;Fields-&amp;gt;Fields[4]-&amp;gt;AsString == Edit3-&amp;gt;Text)//if the text(searched item) = the item in field 4 which is my list of items name
                {
                StringGrid1-&amp;gt;Rows[0]-&amp;gt;CommaText = "ProPM Item_Repaired Descreption Cost Date";
                StringGrid1-&amp;gt;RowCount = i +1;
//All this stuff inputs the info into the cells on the table from the database as long as field 4 is equeal to my search text
                StringGrid1-&amp;gt;Cells[1][i] = Table1-&amp;gt;Fields-&amp;gt;Fields[0]-&amp;gt;AsString;
                StringGrid1-&amp;gt;Cells[2][i] = Table1-&amp;gt;Fields-&amp;gt;Fields[1]-&amp;gt;AsString;
                StringGrid1-&amp;gt;Cells[3][i] = Table1-&amp;gt;Fields-&amp;gt;Fields[2]-&amp;gt;AsInteger;
                StringGrid1-&amp;gt;Cells[4][i] = Table1-&amp;gt;Fields-&amp;gt;Fields[3]-&amp;gt;AsString;
                 i=i+1;
                 money = money + Table1-&amp;gt;Fields-&amp;gt;Fields[2]-&amp;gt;AsInteger;
                 p = 1;
                 }
                 Table1-&amp;gt;Next(); //goes to the next database field
        } while(Table1-&amp;gt;Eof == false) ; //searches database till it the end of hte database
        if(p == 0)
           StringGrid1-&amp;gt;RowCount = 0;
           
        Edit1-&amp;gt;Text = StringGrid1-&amp;gt;RowCount - 1;
        Edit2-&amp;gt;Text = money;

DBNavigator-&amp;gt;BtnClick(nbInsert);

}
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/bcbuilder/389487/389888/re-dbgrid---table-filter-problem/#389888</guid>
      <pubDate>Sun, 26 Apr 2009 20:15:28 -0700</pubDate>
      <category>C++ Builder</category>
    </item>
  </channel>
</rss>