Solved

LIKE '*target*' not match

Posted on 2000-03-13
3
140 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual Basic Excel Formatting error 4 141
Sending a email via excel using vba 6 109
Hide vba in gp 7 118
VB6 - Scroll Mouse wheel on Picturebox 13 98
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…
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…
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…

726 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