Solved

LIKE '*target*' not match

Posted on 2000-03-13
3
139 Views
Last Modified: 2010-05-02
For VB6.0 enterprise, win95

My SQL search criteria is ...
"SELECT * FROM tableName "
"abName LIKE ' " & sTarget & "' "

When sTarget = *kim*, the VB will get all abName with 'kim' match.
e.g. pkimk, kimkk, pkim, kim, ...so forth.

This supposed work fine. But after I change my coding into ADODB to support client/server for ODBC 32bit.
The VB will take '*kim*' as search target instead of 'kim'.

Please advise.
0
Comment
Question by:pkimk
3 Comments
 

Author Comment

by:pkimk
ID: 2611401
DB is Ms. Access 97
0
 
LVL 1

Expert Comment

by:MitchBroadhead
ID: 2611540
TRY

"SELECT * FROM tableName " 
"abName LIKE '*" & sTarget & "*';"

0
 
LVL 43

Accepted Solution

by:
TimCottee earned 100 total points
ID: 2611556
In ADO, you should use the % wildcard rather than * so

sTarget = "%kim%"

"SELECT * FROM tableName " 
"abName LIKE ' " & sTarget & "' " 

0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

860 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