List Info

Thread: help for to search a word in a field




help for to search a word in a field
country flaguser name
United States
2008-03-06 03:31:12

Can you help me to provide command to search a word using input in a
Text field with SQL section. I know there is a command "LIKE" but I
could not get output correctly by applying those.
TEXT1.TEXT = "KUMAR"
rs.open ("SELCT * FROM CUSTOMER WHERE CUSTOMER.NAME
LIKE "TEXT1.TEXT"; "

THE output should be to get all the names contain KUMAR anywhere in a
field.

So please help me with samples programme and it will he highly
appreciated.

Thanks & Regards

Suresh

__._,_.___
.

__,_._,___
Re: help for to search a word in a field
country flaguser name
United States
2008-03-06 05:36:32

SELCT is mispelled
You probably need a wild card (% or * depending on what you are using
and where)

It is cleaner to do this
Dim sSQL as string
Dim sFind as string
Assuming that user is entering data into Text1, do this
sFind = Text1.Text
sSQL = "SELECT * FROM CUSTOMER WHERE CUSTOMER.NAME LIKE " & "%" &
sFind & "%"
Debug.Print sSQL 'So you can see what it looks like, if you have
problem.
Then use sSQL in your .Open

Regards,
Rob

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )