Solved

LIKE '*target*' not match

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

912 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now