?
Solved

ADO, Access 97 & 'LIKE' in Whereclause

Posted on 1999-11-08
6
Medium Priority
?
139 Views
Last Modified: 2010-05-02
I pass a simple select statement to the open method of an ADO recordset and it fails to return any records.  The SQL Statement is:
SELECT * FROM CLIENT
WHERE LAST_NAME LIKE "SMI*"

If I paste this statement into the SQL design window in Access 97, it returns the appropriate # of recs.  All other SQL statement types that I have used that did not include "LIKE" in the Whereclause return the appropriate # of recs.

Any thoughts?

0
Comment
Question by:dfhaines
6 Comments
 
LVL 1

Expert Comment

by:kfehriba
ID: 2192216
Hate to ask... but it never hurts... Are you searching for the same case? The like statement is case sensitive.
0
 

Author Comment

by:dfhaines
ID: 2192239
All data is upper.  Thanks for the heads up, though.
0
 
LVL 26

Accepted Solution

by:
EDDYKT earned 400 total points
ID: 2192243
replace * to %

ie

SELECT * FROM CLIENT
WHERE LAST_NAME LIKE "SMI%"

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 

Expert Comment

by:Sicilian
ID: 2192264
I agree with trying to replace * with % but here are two other things. Use single quotes instead of double quotes and ADO doesn't like any other symbols in it's field names so try putting [] around the field name.

Sicilian
0
 

Author Comment

by:dfhaines
ID: 2192314
EDDYKT,

* -> %.  That did it.  Please answer the question so that I may pass on your points.

Thanks,
DFH
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2192386
Use the "Grade Comment as Answer" feature...

M
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

592 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question