Article View: borland.public.cppbuilder.database.ado
Article #3464Re: Query problem
From: Ola Eriksen
Date: Fri, 02 Aug 2002 08:55
Date: Fri, 02 Aug 2002 08:55
28 lines
1592 bytes
1592 bytes
Try:
Query->SQL->Add("WHERE company.Name =" + Str);
/Ola
Uros Obradovic wrote:
> Hi guys,
> whats wrong in this syntax ?
>
> AnsiString Str = ComboBox1->Items->Strings[index];
>
> Query->Close();
> Query->SQL->Clear();
> Query->SQL->Add("SELECT Division");
> Query->SQL->Add("FROM company, companydivisions");
> Query->SQL->Add("WHERE company.Name = :Str"); <--- I'm getting an error
> in here
> Query->SQL->Add("AND company.DivisionID = companydivisions.DivisionID");
> Query->Open();
>
> I'm getting an error because of Str value ? The value that I'm getting for
> Str is correct, but something is wrong w/ SQL statement.
> Can you help me please
>
> Thanks
> Uros
Technical Details
Message-ID:
<3D4A4915.3ED6B5F@callcom.no>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews!not-for-mailReferences:
<3d49ec08_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,35f59e22a7772b1a X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-08-02 01:05:25 PST Message-ID: <3D4A4915.3ED6B5F@callcom.no> Date: Fri, 02 Aug 2002 09:55:49 +0100 From: Ola Eriksen <ola@callcom.no> X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.database.ado Subject: Re: Query problem References: <3d49ec08_1@dnews> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 217.199.52.30 X-Trace: dnews 1028274968 217.199.52.30 (2 Aug 2002 00:56:08 -0700) Lines: 29 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews!not-for-mail