VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 VP-ASP 6.00 Questions
 why does = not mean =?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dandlyin
VP-ASP New User

USA
73 Posts

Posted - August 04 2006 :  20:15:15  Show Profile  Visit dandlyin's Homepage  Reply with Quote
re: v6.08, using Access

A call to shopquery.asp?ccode=1130 returns products that have 1130 and 113000 as their ccode value- why? Is there a workaround?
Thanks,
Dan Dotson

dandlyin
VP-ASP New User

USA
73 Posts

Posted - August 06 2006 :  06:45:47  Show Profile  Visit dandlyin's Homepage  Reply with Quote
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000