🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

SQL commands problem using WHERE ... LIKE

#1067
From: Joe Myburgh
Date: Sat, 13 Nov 2004 15:17
22 lines
1694 bytes
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: <419625d0@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!fr.ip.ndsoftware.net!border2.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,300c661d49e9152a,start
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
Subject: SQL commands problem using WHERE ... LIKE
Date: Sat, 13 Nov 2004 17:17:51 +0200
Lines: 24
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.128.170
Message-ID: <419625d0@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1100359120 165.165.128.170 (13 Nov 2004 07:18:40 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!fr.ip.ndsoftware.net!border2.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail