Article View: borland.public.cppbuilder.database.ado
Article #1072Re: SQL commands problem using WHERE ... LIKE
From: Joe Myburgh
Date: Mon, 15 Nov 2004 19:12
Date: Mon, 15 Nov 2004 19:12
47 lines
2285 bytes
2285 bytes
Thanks
"Vladimir Stefanovic" <spam@not.needed> wrote in message
news:41962d71@newsgroups.borland.com...
> > DataModule1->adoQSchoolTbl->SQL->Add("WHERE LIKE '%" + Filter +
> "%'");
>
> First try this...
> DataModule1->adoQSchoolTbl->SQL->Add("WHERE SchName LIKE '%" + Filter
> + "%'");
>
>
>
> Best regards,
> Vladimir Stefanovic
>
> Joe Myburgh <joe@compumail.co.za> wrote in message
> news:419625d0@newsgroups.borland.com...
> > Hello
> >
> > I hope someone can help?
> >
> > I have got code like:
> > DataModule1->adoQSchoolTbl->SQL->Add("SELECT");
> > DataModule1->adoQSchoolTbl->SQL->Add("SchID, ProID, RegID,
> MedID,");
> > DataModule1->adoQSchoolTbl->SQL->Add("SchName, SchTel, SchFax,
> Schemail,
> > SchScholars, SchCode");
> > DataModule1->adoQSchoolTbl->SQL->Add("FROM SchoolTbl");
> > DataModule1->adoQSchoolTbl->SQL->Add("WHERE LIKE '%" + Filter +
> "%'");
> >
> > When the dataset open's there is a Exception class EOleException
> with
> > message 'Incorrect syntax near the keyword 'LIKE
> >
> > This is what I try to execute.
> >
> > select SchID, ProID, RegID, MedID,SchName, SchTel, SchFax, Schemail,
> > SchScholars, SchCode from schoolTbl
> > where SchName LIKE '%Jan%'
> >
> > Regards
> >
> >
>
>
Technical Details
Message-ID:
<4198ffec@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<419625d0@newsgroups.borland.com> <41962d71@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,300c661d49e9152a X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Joe Myburgh" <joe@compumail.co.za> From: "Joe Myburgh" <joe@compumail.co.za> Newsgroups: borland.public.cppbuilder.database.ado References: <419625d0@newsgroups.borland.com> <41962d71@newsgroups.borland.com> Subject: Re: SQL commands problem using WHERE ... LIKE Date: Mon, 15 Nov 2004 21:12:48 +0200 Lines: 49 Organization: Lanlink X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 165.165.142.0 Message-ID: <4198ffec@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1100546028 165.165.142.0 (15 Nov 2004 11:13:48 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail