🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: clearing a Query

#5150
From: chenjm
Date: Thu, 26 Jul 2001 04:36
35 lines
2049 bytes
Just do it like this:

>         Form1->ADOQuery1->Close();
>         Form1->ADOQuery1->SQL->Clear();
>         Form1->ADOQuery1->SQL->Add("insert into Table1 (Name) values
> (:parameter1)");
>         Form1->ADOQuery1->Parameters->ParamByName("parameter1")->Value =
> Name;
>         Form1->ADOQuery1->ExecSQL();


"Guy" <guy_kariv@hotmail.com> wrote in message news:3b518911_1@dnews...
> I would like to know how can I use the same TADOQuery component for more
> then one Query ? (tried to use clear function but it just didn't work)
>
> My source code looks like this:
>
>         Form1->ADOQuery1->Parameters->ParamByName("parameter1")->Value =
> Name;
>         Form1->ADOQuery1->Close();
>         Form1->ADOQuery1->SQL->Clear();
>         Form1->ADOQuery1->SQL->Add("insert into Table1 (Name) values
> (:parameter1)");
>         Form1->ADOQuery1->ExecSQL();
>
> When I try to use this function more than one time, it seems that Clear()
> doesn't work and therefore ExecSQL stucks because it gets
> two rows.
>
> In addition to that, how can I write the Query at design time in the SQL
> property ? (This should solve the problem, I guess)
>
> Thanks Guy
>
>
Technical Details
Message-ID: <3b5f9e26_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3b518911_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,4d93d397933a85e1
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-07-25 21:38:47 PST
Reply-To: "chenjm" <chenjm@netease.com>
From: "chenjm" <chenjm@netease.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3b518911_1@dnews>
Subject: Re: clearing a Query
Date: Thu, 26 Jul 2001 12:36:24 +0800
Lines: 37
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: 211.100.71.152
Message-ID: <3b5f9e26_1@dnews>
X-Trace: dnews 996122150 211.100.71.152 (25 Jul 2001 21:35:50 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!dnews