Simple function to Find a Name in a DataBase ignoring assentuation
Simple function to Find a Name in a DataBase ignoring assentuation
Rate Simple function to Find a Name in a DataBase ignoring assentuation
(1(1 Vote))
Public Function CaracterPesquisa(Texto As String) As String
Dim Cont As Long
Dim Char As String
CaracterPesquisa = ""
Texto = UCase(Texto)
For Cont = 1 To Len(Texto)
Char = Mid(Texto, Cont, 1)
If InStr("AÄÁÀÃÂ@", Char) Then
CaracterPesquisa = CaracterPesquisa & "[AÄÁÀÃÂ@]"
ElseIf InStr("EËÉÈÊ", Char) Then
CaracterPesquisa = CaracterPesquisa & "[EËÉÈÊ]"
ElseIf InStr("IÏÍÌÎ", Char) Then
CaracterPesquisa = CaracterPesquisa & "[IÏÍÌÎ]"
ElseIf InStr("OÖÓÒÕÔ", Char) Then
CaracterPesquisa = CaracterPesquisa & "[OÖÓÒÕÔ]"
ElseIf InStr("UÜÚÙÛ", Char) Then
CaracterPesquisa = CaracterPesquisa & "[UÜÚÙÛ]"
ElseIf InStr("CÇ", Char) Then
CaracterPesquisa = CaracterPesquisa & "[CÇ]"
ElseIf Char = " " Then
CaracterPesquisa = CaracterPesquisa & "*"
Else
CaracterPesquisa = CaracterPesquisa & Char
End If
Next
End Function
'In Your Code
Sql$ = "Select * From YourTable Where UCase(Nome) Like '*" & CaracterPesquisa(CStr(Xstr)) & "*'"
Simple function to Find a Name in a DataBase ignoring assentuation Comments
No comments yet — be the first to post one!
Post a Comment