🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: multiple sql statement using TADOQuery

#770
From: James Peterson
Date: Fri, 08 Apr 2005 16:23
43 lines
2068 bytes
not sure if this will work but you can get the jist of an idea.

query->SQL->Add("Select * from table);
query1->SQL->Clear();
query->Open();
while(!query->Eof)
{
   if (query->FieldByName("DisplayStatus")->AsValue > 4)
         query1->SQL->Add("update table set conn =
"query->FieldByName("conn")->AsValue *2);
   else
        query1->SQL->Add("update table set conn = 0");
   query1->Execute();
}


"siraj" <siraj.sm@omnisens.ch> wrote in message
news:419367c2@newsgroups.borland.com...
> Hi!
> I am using c++ builder 5 and access 2000. I connect using ADO components.
> I have a TDBChart and the datasource of the Series on the chart is
> TADOQuery.
> Using the ADOQuery, I query a table in access 2000. The recordset should
be
> modified depending on the value of one of the field in the table.
> For example,
> In my table,  I have name,timestamp,conc,DisplayStatus.
> If DisplayStatus>4 then
> conc=conc*2;
> else
> conc=0
>
> How can i make the ADOQuery return the resultset depending on the above
> rule.
>
> It is something like a batch sql statement.
>
> How can I do this? Any code samples?
>
> Regards
> Siraj
>
>
Technical Details
Message-ID: <4256b006$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <419367c2@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,33c67b2d6bc6ce6
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "James Peterson" <jpeterson@romanmealmilling.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <419367c2@newsgroups.borland.com>
Subject: Re: multiple sql statement using TADOQuery
Date: Fri, 8 Apr 2005 11:23:35 -0500
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 64.21.236.129
Message-ID: <4256b006$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1112977414 64.21.236.129 (8 Apr 2005 09:23:34 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail