[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 144
  • Last Modified:

LIKE '*target*' not match

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
pkimk
Asked:
pkimk
1 Solution
 
pkimkAuthor Commented:
DB is Ms. Access 97
0
 
MitchBroadheadCommented:
TRY

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

0
 
TimCotteeCommented:
In ADO, you should use the % wildcard rather than * so

sTarget = "%kim%"

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

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now