[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 145
  • 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

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

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