🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #4718

using ado command

#4718
From: Paolo Casagrande
Date: Mon, 19 Nov 2001 15:57
32 lines
1929 bytes
in our application we have a DBGrid linked to a TADOTable that is filter on
user input. we have include a field (say Flag) in the table that is set to 0
or 1 depending on the user input, than table is filtered by "Flag = 1" (we
can't use the Filter/Filtered properties because the conditions can't be
write using SQL syntax).

first we set flag to zero in this way

    DB_Cmd->CommandText = "UPDATE [Article] SET [Flag] = 0";
    DB_Cmd->CommandType = cmdText;
    DB->BeginTrans();
    DB_Cmd->Execute();
    DB->CommitTrans();

than we set a complex filter (where f is a string build from user inputs):

    DB_Cmd->CommandText = "UPDATE [Article] SET [Flag] = 1 WHERE " + f;
    DB_Cmd->CommandType = cmdText;
    DB->BeginTrans();
    DB_Cmd->Execute();
    DB->CommitTrans();

last we reset some Flag (to zero) looking raw by raw.

if we don't close and reopen the table:

        T_Article->Active = false;
        T_Article->Active = true;

we can't see the right filter. Why? please help me, is very important.

thanks, Paolo
Technical Details
Message-ID: <3bf92c01$1_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,3f5c1d7fd68378,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-11-19 08:13:41 PST
From: "Paolo Casagrande" <nemesis@intelly.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: using ado command
Date: Mon, 19 Nov 2001 16:57:27 +0100
Lines: 35
Organization: intellySoft
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 151.25.28.230
Message-ID: <3bf92c01$1_2@dnews>
X-Trace: dnews 1006185473 151.25.28.230 (19 Nov 2001 07:57:53 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews