thunderain
Programmer
Hello:
I am using ASP with vbScript. I have an search sql statement using "like", "not like" and "fuzzy match" that I need to send through a link. When i send it through a link, it loses it's % characters on the receiving page. Using replace, i am trying to replace the % characters in the sql statement. The entire sql statement is quite lengthy and i only need to show a portion to show what is happening.
Portion of original sql statement:
(EntryLP like '%M%[5S]%F%9%') OR (EntryLP like '%M%[5S]%F%9%[B8]%'))
When i pass it through a link, it loses it's %'s and looks like this:
(EntryLP like 'M[5S]F9') OR (EntryLP like 'M[5S]F9[B8]'))
I am trying to use Replace to put them back in, using wildcards. I have read that % is a wild card but I can't seem to get it working. I don't think I am using it quite correctly. I have tried several ways but here is closest one i figure should work but doesn't.
strSQL = Replace(strSQL,"like '"%%%%%%"'", "like '%"%"%"%"%"%"%"%"%"%"%"%"%"%"%'"
It is particularly hard when the wildcard and the character i'm trying to put in are the same (%).
If anyone can help it would be gratefully appreciated.
Thanx
thunderain
I am using ASP with vbScript. I have an search sql statement using "like", "not like" and "fuzzy match" that I need to send through a link. When i send it through a link, it loses it's % characters on the receiving page. Using replace, i am trying to replace the % characters in the sql statement. The entire sql statement is quite lengthy and i only need to show a portion to show what is happening.
Portion of original sql statement:
(EntryLP like '%M%[5S]%F%9%') OR (EntryLP like '%M%[5S]%F%9%[B8]%'))
When i pass it through a link, it loses it's %'s and looks like this:
(EntryLP like 'M[5S]F9') OR (EntryLP like 'M[5S]F9[B8]'))
I am trying to use Replace to put them back in, using wildcards. I have read that % is a wild card but I can't seem to get it working. I don't think I am using it quite correctly. I have tried several ways but here is closest one i figure should work but doesn't.
strSQL = Replace(strSQL,"like '"%%%%%%"'", "like '%"%"%"%"%"%"%"%"%"%"%"%"%"%"%'"
It is particularly hard when the wildcard and the character i'm trying to put in are the same (%).
If anyone can help it would be gratefully appreciated.
Thanx
thunderain