Table name prefixes are important in VFP

Our client asked for a change to an order entry screen in one of our Visual FoxPro applications.  Our senior programmer Mike, accidentally left off the table prefix for one of the fields in a SQL SELECT statement. The net result was that the work tickets printed from the final SQL cursor, sometimes printed customer information and some times didn’t.  After some digging, I found that 2 of the tables in the SQL SELECT statement had the same field name.  The SQL SELECT got confused and sometimes returned the customer information and sometimes didn’t on the printed work ticket. I added the table name prefix to the field and did some testing.

Sure enough, the work tickets that didn’t print the customer information now had the relevant information printed in the proper spot. Our client was happy with the result.

Leave a Reply

You must be logged in to post a comment.