|
-
Feb 13th, 2008, 07:24 AM
#1
Thread Starter
Member
[RESOLVED] a little help in case sensitivity
in my program, i have a textbox that specifies what data i will be searching in the database and diplaying it in the flexgrid... my problem is that it is case sensitive. How can i make the searching case insensitive? any ideas!?
-
Feb 13th, 2008, 07:44 AM
#2
Re: a little help in case sensitivity
What database are you using. I don't think case sensitivity is provided by default in any database. I guess you are missing something.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Feb 13th, 2008, 07:44 AM
#3
Re: a little help in case sensitivity
Use either UCase or LCase whichever would be the most appropriate.
-
Feb 13th, 2008, 07:56 AM
#4
Thread Starter
Member
Re: a little help in case sensitivity
-
Feb 13th, 2008, 07:57 AM
#5
Re: a little help in case sensitivity
It would probably be beneficial to know what is actually (in terms of case) being stored. All upper? All lower? Mixture? Provide an example.
-
Feb 13th, 2008, 08:33 AM
#6
Thread Starter
Member
Re: a little help in case sensitivity
o i c... it's a mixture in the database... So when I searched for the word "Wheels" it displays all columns with related to "Wheels" however "wheels" doesn't return anything at all
-
Feb 13th, 2008, 08:39 AM
#7
Frenzied Member
Re: a little help in case sensitivity
When you do a search, search for UCase("Wheels") and use the same for what is returned from the database,
UCase(RSet.Fields("FieldName").Value)
-
Feb 13th, 2008, 08:50 AM
#8
Thread Starter
Member
Re: a little help in case sensitivity
thank you very much... but how do I use it in an SQL statement?...
here is my code for searching
Code:
Data1.RecordSource _
= "SELECT * FROM AERO " _
& "Where Description = '" & Text1.Text & " '"
-
Feb 13th, 2008, 08:58 AM
#9
Frenzied Member
Re: a little help in case sensitivity
Well you would change Text1.Text to UCase(Text1.Text)
and then I think you would so something like this;
Code:
Data1.RecordSource _
= "SELECT * FROM AERO " _
& "Where Description = '" & UCase(Text1.Text) & " '"
UCase(Data1.RecordSource.Fields("FieldName").Value)
I haven't tested this, and I'm not too sure, but give it a go
-
Feb 13th, 2008, 09:03 AM
#10
Thread Starter
Member
Re: a little help in case sensitivity
well it didn't work but still thank you so much for the idea... guess I have no choice but to use a looping statement^^
-
Feb 13th, 2008, 09:09 AM
#11
Frenzied Member
Re: [RESOLVED] a little help in case sensitivity
If it helps, this is some code I have used for searching in the past and adding results to a listbox, using Access and ADO.
You would just have to add the 'UCase' to it:
Code:
strSQL = "SELECT * FROM tbl_Code"
strSQL = strSQL & " WHERE 'N' & NodeID = '" & tmpCat & "'"
strSQL = strSQL & " And (Code_Description LIKE '%" & strSearch & "%' OR Code_Text LIKE '%" & strSearch & "%')"
End If
rs.Open strSQL, cn, adOpenForwardOnly, adLockReadOnly, adCmdText
Do While Not rs.EOF
With lstSearch
.AddItem rs.Fields("Code_Description")
ctr = ctr + 1
End With
rs.MoveNext
Loop
rs.Close
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
|
Click Here to Expand Forum to Full Width
|