🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: SQL commands problem using WHERE ... LIKE

#1068
From: Vladimir Stefanovic
Date: Sat, 13 Nov 2004 15:50
42 lines
1978 bytes
>  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: <41962d71@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <419625d0@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
From: "Vladimir Stefanovic" <spam@not.needed>
Newsgroups: borland.public.cppbuilder.database.ado
References: <419625d0@newsgroups.borland.com>
Subject: Re: SQL commands problem using WHERE ... LIKE
Date: Sat, 13 Nov 2004 16:50:38 +0100
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: 213.137.116.135
Message-ID: <41962d71@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1100361073 213.137.116.135 (13 Nov 2004 07:51:13 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail