by RMad (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Mon 17th May 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Simple function to Find a Name in a DataBase ignoring assentuation
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)) & "*'"
No comments have been posted about Simple function to Find a Name in a DataBase ignoring assentuation. Why not be the first to post a comment about Simple function to Find a Name in a DataBase ignoring assentuation.