Problem with "%" character

francisco cobos

Member
Licensed User
Longtime User
Hello,
I'm trying to filter a csv database, but I get an error when the variable "cad" has a % in the string: (cad="something%"), f example:

Table1.Filter("cara_pcb LIKE '"&cara& "'AND " &campo & " LIKE '" & cad & "'")

This works well if the strings don't contain any "%" or "[]"
Is there any other method?
 

francisco cobos

Member
Licensed User
Longtime User
Problem with % character

You should enclose %, [ and ] characters with [].
Example: 'something[%]'

I've tried this, but I get the same error, if I don't include this character there is no problem ¿?
cad="H64 10[%] 100V LDIL10 AVX/NI"
 

francisco cobos

Member
Licensed User
Longtime User
problem with % character

I've tried this, but I get the same error, if I don't include this character there is no problem ¿?
cad="H64 10[%] 100V LDIL10 AVX/NI"

I'm sorry Erel, I was worng:
I have tried again your solution and now is fine,
Thanks!

Anyway, is there any solution for not to have to change the data in the data base?
 
Top