Hi,
The problem happen when I use Promatrix framework, but it is actually a common VFP view problem so I post it here in order to seek for extra and faster help.
I have a search view which always come up empty when it suppose to have 1 record!
The search view's SELECT command reads:
SELECT Stblcomp.compnam1, Stblcomp.compnam2, Stblcomp.compsnam, Stblcomp.compnick, Stblcomp.comprobn
FROM ustb!stblcomp
WHERE ( ( ( Stblcomp.compnam1 = ( ?GETcompnam1 ) AND Stblcomp.compnam2 = ( ?GETcompnam2 ) )
AND Stblcomp.compsnam = ( ?GETcompsnam)) AND Stblcomp.compnick = ( ?GETcompnick ) )
AND Stblcomp.comprobn = ( ?GETcomprobn )
Though it has 5 filter variables in it, the one that will be actually used in my test is Stblcomp.compnam1 = ( ?GETcompnam1 )
The view is opened with USE command in the framework:
USE (slcViewName) ALIAS (slcAlias) &slcClauses
IF slcAlias = [V_RIDUP]
SET STEP ON
BROWSE
ENDIF
When the SET STEP ON bring up the debugger:
In the debugger 's LOCAL window:
slcAlias is [V_RiDup]
slcClauses is ""
GETcompnam1 is "Highclass Computer Software "
GETcompnam2 is "%"
GETcompsnam is "%"
GETcompnick is "%"
GETcomprobn is "%"
In the debugger's WATCH window:
ALIAS() is [V_RIDUP]
EOF() is .T.
BOF() is .T.
SET("EXACT") is "OFF"
LEN(stblcomp.compnam1) is 40
LEN(GETcompnam1) is 40
The BROWSE after the SET STEP ON as shown above always come up empty... that is the view has no data in it.
However, If I browse directly the underlying table stblcomp which the above view is based on I can find a record whose compnam1 field is "Highclass Computer Software "
I really can't find where could be the error that cause the view to open up empty, it should contain 1 record
Anything else that I could have missed? or any tips on debugging this kind of error?
Btw,
if I try to change the filter Stblcomp.compnam1 = ( ?GETcompnam1 ) to Stblcomp.compnam1 LIKE ( ?GETcompnam1 ), the view come up with 1 record. But I can't use LIKE here because the search view is used to check for duplicated field values.