I was investigating why a simple query (SELECT DISTINCT srep FROM order WHERE srep <> "") worked on my machine and yet when deployed, it did NOT work.  Instead of returning several dozen names, it was returning zero.  Now..."why did it work before?" Well, I had changed the query from using WHERE NOT EMPTY(srep) to what you see at the top of this post.

I figured it was the SET ANSI and confirmed it.  I see the original developer explicitly says in the startup code SET ANSI OFF.

I just can't understand why.  This is very old code so I ask those who've been in the Fox game since 2.x days---was this an advantage when using some sort of xBase approach?  I realize from VFP help that SET ANSI ON basically makes sure string comparisons are of equal length.

I'm nervous about changing the value at startup because there are probably areas where the code is COUNTING on it.  I see they also have SET NEAR ON and SET EXACT OFF.   I guess code where I'm putting my own SQL in there (or changing it), I should save their settings, set as I would normally work (EXACT ON, ANSI ON, NEAR OFF), and then restore their settings.  Kinda like that WorkAreaSave class that I learned (from Andy/Marcia?) way back when to use a lightweight class in a local variable to save the current work area when you start a procedure/function and then it restores it because the LOCAL variable is released on exit.


--
Michael J. Babcock, MCP
Fox/VFP dev since 1997
Developer of FabNet estimating software - mbsoftwaresolutions.com


_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/b2754848-c6ca-f046-51f6-7119fbf27...@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to