🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

using ado command

#4719
From: Paolo Casagrande
Date: Mon, 19 Nov 2001 16:14
32 lines
1930 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: <3bf92fda$1_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newshub2.rdc1.sfba.home.com!news.home.com!newsfeed.mesh.ad.jp!uunet!osa.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,3f5c1d7fd68378
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-11-19 08:35:08 PST
From: "Paolo Casagrande" <nemesis@intelly.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: using ado command
Date: Mon, 19 Nov 2001 17:14:47 +0100
Lines: 37
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: <3bf92fda$1_1@dnews>
X-Trace: dnews 1006186458 151.25.28.230 (19 Nov 2001 08:14:18 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newshub2.rdc1.sfba.home.com!news.home.com!newsfeed.mesh.ad.jp!uunet!osa.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews