ViewEditor Bug
I received a bug report this week for ViewEditor Professional that took a little time to track down. I don't have time to immediately fix it so I want to pass this along to the developers with two simple workarounds to use until I can figure out the best solution.
The bug is only revealed under a specific circumstance and has likely been a bug since ViewEditor Professional was originally written back in 2002. The bug shows itself when you save the view you are working on. The save process verifies the view's SQL code is valid and reports any problems with the SQL code. During this process all view parameters are substituted using the VFP STRTRAN() function. Depending the substitution sequence of the view parameters and the names of the view parameters, an incorrect substitution occurs. The problem only happens when you have two view parameters starting with the same characters.
?vp_lActive = .F.If vp_lActive is STRTRAN'ed first you see the validation code after the substitution to be:
?vp_lActiveArchive = .T.
SELECT cCustomerID, cCustomerName ;
FROM Customer ;
WHERE ?vp_lActive = .T. ;
AND ?vp_lActiveArchive = .T.
SELECT cCustomerID, cCustomerName ;
FROM Customer ;
WHERE .F. = .T. ;
AND .F.Archive = .T.
The two workarounds (use one or the other):
- Do not name your view parameters starting with the same characters.
- Shut off the validation process when saving views by unchecking the Validate SQL checkbox on the SQL page.
Labels: Bugs, ViewEditor, WLC Announcements