Article View: borland.public.cppbuilder.database.ado
Article #5109problem with (probably) ExecSQL during loop insertion
From: Guy
Date: Fri, 13 Jul 2001 14:42
Date: Fri, 13 Jul 2001 14:42
25 lines
1804 bytes
1804 bytes
Hi, I tried to write a function that reads some data from a TStringList
Object and inserts it to DB Table dynamicly using a loop.
This is our source code: (
TStringList *Labels=new TStringList;
Labels->LoadFromFile("Labels.txt");
Form1->TADOQuery1->Parameters->ParamByName("v_Name")->Value = Name;
for (int i=0; i<Labels->Count; i++)
{
String Label=Labels->Strings[i];
Form1->TADOQuery1->Parameters->ParamByName("v_Label")->Value
= Label;
Form1->TADOQuery1->SQL->Clear();
Form1->TADOQuery1->SQL->Add("insert into Table1 values
(:v_Name, :v_Label)");
Form1->TADOQuery1->ExecSQL();
}
It works propertly only in the first iteration. Then (during the second
iteration) it stucks on the ExecSQL line.
Does anybody knows how to fix it?
Thanks Guy
Technical Details
Message-ID:
<3b4efb1d_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!128.230.129.106!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,8147153c2309c21b,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-07-13 06:44:47 PST Reply-To: "Guy" <guy_kariv@hotmail.com> From: "Guy" <guy_kariv@hotmail.com> Newsgroups: borland.public.cppbuilder.database.ado Subject: problem with (probably) ExecSQL during loop insertion Date: Fri, 13 Jul 2001 16:42:55 +0200 Lines: 27 Organization: Student X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 213.8.243.212 Message-ID: <3b4efb1d_1@dnews> X-Trace: dnews 995031837 213.8.243.212 (13 Jul 2001 06:43:57 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!128.230.129.106!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews