-
Searching an MSFLEXGRID without typing in whole name
HI,
Currently I have an MSFLEXGRID with a search function. It works fine, However, I am using it for my DvD collection and for a title to show up in a search, you have to type the whole title in exactly.
Currently I am using this..:
Data2.RecordSource = "select * from CDs where Title = '" + search.Text + "'"
which will just show whatever title i typed in the 'search.text' text box.
However, I was wondering if it is possible to make it so that say for example, If 3 letters match then it will show them. So if i had in there...
HARRY POTTER 1
HARRY POTTER 2
HARRY POTTER 3 (etc, you get the picture)
then if i searched say, 'harry' or 'har' then all three would show up?
Thanks,
Jenks
-
Hi!
You can use LIKE operator instead = operator in your SQL sentence, plus some wildcards:
e.g.
"select * from CDs where Title LIKE '" & search.Text & "*'"
I think this should do the trick.
HTH,
mc
-
..
Hi, I put in
Data1.RecordSource = "select * from CDs where Title LIKE '" + Text1.Text + "'"
No errors occur or anything, however it still requires me to type in the whole name ( and has to be exact) for it to work?
any other ideas?
Thanks
Jenks
-
you forgot to append the * wildcard at the end of the name (actually, isn't that a %, at least in msql?)
Marco
"There are two ways to write error-free programs. Only the third one works."
Unknown
-
Thanks alot..it works fine now ....and btw it was * incase you were wondering..
Thanks
Jenks
-
i have been looking for a way to search a MSFlexGrid column. but havent been able to find one. can i get any help on this matter?
-
hi there
Data1.RecordSource = "SELECT * FROM CDs WHERE Title LIKE '%" & Text1.Text & "%'"
try this....i try this for my searching value......
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|