Rowfilter with wildcard

Hi all, 

I'm coding a little window that will filter my database.
In the textbox of that window, i can use the wildcards * and   for a single character. 

The problem is when the user use the * it work number one, but when he use the   wildcard, it always return nothing. It work in SQL but not in the rowfilter   

This is what the user write in the textbox : m test

CODE START
'Replace all The wildcard into rowfilter characters

strValeur2 = textbox.text
strValeur2 = Replace(strValeur2, "*", "%", 1)
strValeur2 = Replace(strValeur2, " ", "_", 1)
strValeur2 = Replace(strValeur2, "'", "''", 1)

'Create rowfilter string
strFilter = " (" & strColumnName & ") " & strOperator1 & " ('" & strValeur2 &"') "
CODE END

The string result is : strFilter = "(ColumnName) LIKE ('m_test')" 

Thanks all in advance for your time guys !!!


Answer this question

Rowfilter with wildcard

  • Vidya Vrat Agarwal

    I have found my answer !!

    Here's the information in case it happens to you

    From: http://bdn.borland.com/borcon2004/article/paper/0,1963,32284,00.html

    "The only wildcard supported is % ( or *) which represents zero or more characters. There is no support for _ ( or  ) which represents a single character."

    Hope it will help someone !!

  • Rowfilter with wildcard