dX********@bway.net.invalid (David W. Fenton) wrote in
news:94***************************@24.168.128.74:
Mi************@Invalid.Com (Lyle Fairfield) wrote in
<Xn*******************@130.133.1.4>:
Randy <an*******@devdex.com> wrote in news:3fe3359a$0$198$75868355
@news.frii.net:
I tried both and got the same results:
This did not return results:
SELECT PN, Qty From Inventory Where PN Like 'SSW-101' & '%'
and this returned two as before:
SELECT PN, Qty From Inventory Where PN Like 'SSW-10' & '%'
Note: just for kicks, I used the wildcard on both sides as in:
SELECT PN, Qty From Inventory Where PN Like '%101%'
.. and it returned the results I expected.
from ADO help:
In a LIKE clause, you can use a wildcard at the beginning and end
of the pattern (for example, LastName Like '*mit*') or only at the
end of the pattern (for example, LastName Like 'Smit*').
???
But not:
LastName Like '*son'
Is that correct?
I believe that it is.
But, this is not a simple issue. Although the help file uses "*" in its
example, it seems that "%" is the character that must be used.
And MS has different answers in different articles. Here is one from KB
225048 which outlines Issues Migrating from DAO/Jet to ADO/Jet.
**** begin quote ****
Wild Card Characters
The query wild-card characters are different in DAO than in ADO. DAO exposes
the following characters for use with the SQL LIKE operator:
Character Function
* Match any string
? Match any character
# Match any digit
[a-cf] Match any of 'a' through 'c' or 'f'
[~a-c] Match anything but of 'a' through 'c'
ADO exposes the following ANSI wildcard characters:
Character Function
% Match any string
_ Match any character
Wildcards and Stored Queries
If you have a stored QueryDef in an MDB file, created through Access or DAO,
that uses wildcard characters, it will not return any records if run under
ADO. The OLEDB provider for Jet recompiles the SQL and tells the query engine
to use the ANSI wildcard characters (see table above).
If you create a QueryDef in a Jet 4.0 database using the ADO CREATE PROCEDURE
or CREATE VIEW statements and ANSI wildcards, the queries will not run
correctly under DAO 3.6. More information on ANSI query issues is in the
"Access 2000 and Legacy Application Compatibility" section later in this
article.
**** end quote ****
Although I am an ADO enthusiast this article raises issues that have made me
reconsider any notion I may have had about using ADO with JET.
<
http://support.microsoft.com/default.aspx?
scid=http://support.microsoft.com:80/support/kb/articles/Q225/0/48.ASP&NoWebC
ontent=1>
--
Lyle
(for e-mail refer to
http://ffdba.com/contacts.htm)