dandlyin
VP-CART New User
USA
73 Posts |
Posted - August 06 2006 : 06:45:47
|
I found the problem. For all text variables, including ccode, the script shopproductcreatesql.asp creates a query that returns all records that CONTAIN the input text. Around line 316:
if fieldtype="Text" or fieldtype="Memo" then If ucase(strvalue)=allvalues then ' make all really mean all strvalue="" end if addprefix tvalue=cleanchars(strvalue) SQL=SQL & " p." & strname & " like '" & queryprefix & tvalue & "%'"
I find this unsatisfactory. In my opinion, a flag should be added to permit setting the query to reurn only those records that EQUAL the input text.
Here is my solution:
Around line 304, add dim forcematch forcematch="" forcematch=request("forcematch")
and replace the line that reads SQL=SQL & " p." & strname & " like '" & queryprefix & tvalue & "%'" with
if forcematch <> "" then SQL=SQL & " p." & strname & "='" & tvalue & "'" else SQL=SQL & " p." & strname & " like '" & queryprefix & tvalue & "%'" end if
Now a call shopquery.asp?ccode=87&forcematch=1 returns only the record where ccode=87
This solution works for me but as always, I welcome comments. Regards Dan Dotson |
|
|