Article View: borland.public.cppbuilder.database.multi-tier
Article #1012In desperat need of help!
From: Jenny Asplund
Date: Wed, 21 Jun 2000 00:00
Date: Wed, 21 Jun 2000 00:00
47 lines
2192 bytes
2192 bytes
Hi!
Don't know if this is the right newsgroup but here it goes.
I have a program with a database containing facts about music CD's.
In my program I have a ComboBox where I choose what to search for (e.g.
artist, track, albumtitle etc.) and a Edit-box where i enter word of
phrase to search for.
The c++ code looks like this:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
if(ComboBox1->Text = ="Artist")
{
DBGrid1->DataSource=DataSource5;
Query4->Close();
AnsiString AName=(AnsiString)"AName";
Query4->ParamByName(AName)->AsString=Edit1->Text;
Query4->Open();
}
And the SQL-statement in the Query-component looks like this:
SELECT DISTINCT Artist, Album, Release FROM Artist, Album, Track
WHERE Artist LIKE :AName
AND Artist.AID = Track.AID
AND Track.CDID = Album.CDID
The SQL-statement works with no errors but I have the need to search
with wildcards in order to for example serch by artist and for rage and
get Rage Against The Machine in the DBGrid. (I hope you understand what
I mean)
The problem is this, I don't know how to use wildcards. In Access97 that
I use for my database, I can use '*rage*' and in other databases they
use % instead of *. The problem is that it does not work in a Query with
SQL-statement and parameters. I've tried to write '*:AName*', '%:AName%'
and so on but it doesn't work.
Can anyone help me and tell me where and how to use wildcards? In
desperat need of help because this program has to be finished and handed
over to my teacher sunday the 25:th of june.
Tnx in advanced!
///Jenny Asplund, Linkoping Sweden
Technical Details
Message-ID:
<39510530.3B1C3E40@hem.passagen.se>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcd2b,f87b6e8a69c0b435,start X-Google-Attributes: gidfcd2b,public From: Jenny Asplund <jen8@hem.passagen.se> Subject: In desperat need of help! Date: 2000/06/21 Message-ID: <39510530.3B1C3E40@hem.passagen.se> X-Deja-AN: 637310243 Content-Transfer-Encoding: 7bit Organization: Another Netscape Collabra Server User X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.cppbuilder.database.multi-tier