Article View: borland.public.cppbuilder.database.ado
Article #3482Re: How to Search such record
From: Giuliano
Date: Sun, 04 Aug 2002 10:02
Date: Sun, 04 Aug 2002 10:02
79 lines
3421 bytes
3421 bytes
On Sat, 3 Aug 2002 23:15:15 +0800, "HuangC" <akeehuang@163.net> wrote:
>I'm using MS Access database.
I can confirm that using
LIKE '%something%'
with JET OleDb databases works like a charm.
I've tried with the database coming with BCB and ADOExpress components:
I've used a TADOConnection and a TADODataSet. Providing the ADOConnection with
the following ConnectionString
ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;"
"Data Source=C:\\Program Files\\Common Files\\Borland "
"Shared\\Data\\bcdemos.mdb;"
"Mode=Share Deny None;Extended Properties=\"\";"
"Jet OLEDB:System database=\"\";"
"Jet OLEDB:Registry Path=\"\";"
"Jet OLEDB:Database Password=\"\";"
"Jet OLEDB:Engine Type=5;"
"Jet OLEDB:Database Locking Mode=1;"
"Jet OLEDB:Global Partial Bulk Ops=2;"
"Jet OLEDB:Global Bulk Transactions=1;"
"Jet OLEDB:New Database Password=\"\";"
"Jet OLEDB:Create System Database=False;"
"Jet OLEDB:Encrypt Database=False;"
"Jet OLEDB:Don't Copy Locale on Compact=False;"
"Jet OLEDB:Compact Without Replica Repair=False;"
"Jet OLEDB:SFP=False";
then filling the TAdoDataSet's CommandText property with the following
statement
SELECT FirstName
FROM employee
WHERE FirstName LIKE '%er%'
I can be able to obtain the following relation:
+-----------------------------+
| FIRSTNAME |
+-----------------------------+
| Roberto |
| Terri |
| Katherine |
| Roger |
| Roger |
| Walter |
| Jennifer M. |
| Oliver H. |
| Roberto |
| Pierre |
+-----------------------------+
that is
+-----------------------------+
| FIRSTNAME |
+-----------------------------+
| Rob[er]to |
| T[er]ri |
| Kath[er]ine |
| Rog[er] |
| Rog[er] |
| Walt[er] |
| Jennif[er] M. |
| Oliv[er] H. |
| Rob[er]to |
| Pi[er]re |
+-----------------------------+
Good Luck.
Ciao!
Giuliano
Technical Details
Message-ID:
<8ttpkucsg938koq5nvpcitckbnnqu0gsgq@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews!not-for-mailReferences:
<3d4a47da$1_2@dnews> <q3jkku0edmlan5gv4rjs41ir7of9jedme0@4ax.com> <3d4b49fc$1_2@dnews> <nk8nku8joqlrar3sst3nqgnpiq33huj862@4ax.com> <3d4bf34a$1_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,679d71d5dccfc870 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-08-04 03:11:25 PST From: Giuliano <gcardinali@remove.adhoc.net> Newsgroups: borland.public.cppbuilder.database.ado Subject: Re: How to Search such record Date: Sun, 04 Aug 2002 12:02:39 +0200 Message-ID: <8ttpkucsg938koq5nvpcitckbnnqu0gsgq@4ax.com> References: <3d4a47da$1_2@dnews> <q3jkku0edmlan5gv4rjs41ir7of9jedme0@4ax.com> <3d4b49fc$1_2@dnews> <nk8nku8joqlrar3sst3nqgnpiq33huj862@4ax.com> <3d4bf34a$1_1@dnews> X-Newsreader: Forte Agent 1.91/32.564 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 194.183.77.212 X-Trace: dnews 1028455358 194.183.77.212 (4 Aug 2002 03:02:38 -0700) Lines: 79 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews!not-for-mail