====================================== FoxPro Developers Network of San Diego ====================================== FoxDev TipsLetter #01-05 Website: Editor: ---------------------------------------------------------------------- CONTENTS: * Calendar * Tech Tips: * Updating a View - Oops! Dan Covill * Links: Where Can I Find...? * Other Stuff: * Automated Test Tool in VFP7 Robert Green * The Future of VFP Whil Hentzen * Metaphors, Not Conversations Dan Bricklin * Administrivia ====================================================================== CALENDAR: All meetings are in Escondido, at 6:30 pm. May 2 ----- Mike Cummings from Orange County will be speaking on HTML and the browser for reports. He'll also discuss "Excel reports for free". June 6 ------ Ken Glassman, CEO and founder of Innovative Training will talk to us about Visual FoxPro 7.0, migration issues, language changes and it's positioning (or lack of) within the .Net applications framework. The discussion will include a presentation encompassing the .Net architecture as well as VFP 7.0 specific issues. If you're at all curious about how Microsoft's latest technology suite will affect you, please attend! July 11 (The 1st Wed in July is the 4th) ------- Our own Art Bergquist will show us how to to use OLE automation from within VFP to control Outlook and Word. August 1 -------- Tips and Tricks. Got some really cool utility you'd like to show off? Or maybe you've discovered a better way to accomplish something. This is your chance to show off! Just reply to this e-mail with a brief description of what you'd like to show. *** SPECIAL DATE *** Sept 13 (Thursday) ------- Doug Hennig - topic TBA We've rescheduled our regular meeting to right after Devcon so that we can bring you Doug Hennig, the creator of Stonefield Database Toolkit, and regular author in FoxTalk. -------------------------------------------------------------------- Escondido meetings are at Bergelectric, 2222 Meyers Avenue. Take the Nordahl exit from Highway 78 (west of I-15). Head South. Right on Meyers Ave, first right past Mission. It's a one-story building on the right (there's no sign). ====================================================================== TIPS ====================================================================== UPDATING A VIEW - OOPS! by Dan Covill Inspired by Barbara Peisch's talk at our March meeting, I decided to try using a View. (Well, actually, I was mainly trying to duck the well-known problem of my grid losing its brains whenever I re-queried its underlying cursor - but I digress.) Since I didn't have a single unique key, I defined Employee and Date as keys and set UpdateType to 2 - "delete all records and replace." Being gullible, I thought it might work. Oops! If the user has two records on the same day with the same record code, and deletes one of them, they both disappear on the update. Why? (Everything else works fine.) The ProFox forum provided the answer, in two parts. ---------------------------------------- Reply from Ed Leafe: Updating a view with a deleted record generates a SQL-DELETE request for the PK of the deleted record. In your case, you have two records in your view with the same PK - a definite no-no. In your case, Fox is generating the following command: DELETE FROM TSDETAIL ; WHERE TS_EMPL = [deleted record's value] ; AND TS_DATE = [deleted record's value] ----------------------------------------------------------- Me, whining: But I used UpdateType = 2 for precisely that reason. I expected the SQL-DELETE to delete all the records for that date. Then an SQL-UPDATE would insert new ones from my view. As I expected, the two original records get deleted. But the one I still had in the view never got inserted. ----------------------------------------------------------- Reply from Ed Leafe UpdateType = 2 is ignored for VFP tables. It only applies to SQL Server and other RDBMS backends, which have that option built in for updating. --------------------------------------------- Ahah!! I set UpdateType back to 1, then added the record code and begin time as "key fields". They're 99 44/100% unique, and the bloody thing works!!! The key lay in the news that UpdateType = 2 doesn't work. (But why would MS bother to tell me that?) Agreed, I really need a unique key, but since two records with same Code can't have the same start time, this is "good enough for government work". Dan Covill dcovill@san.rr.com ====================================================================== LINKS ====================================================================== This is a (semi) permanent list of places to look for technical help when you get blind-sided by the latest urgent requirement. We don't give specific URLs for MSDN articles because (a) they're too long and (b) they change too often! ------------------------------- MSDN ON LINE: There's a ton of stuff here, look at the Magazines tab, and read some of the regular columns. MSDN Library Look in Technical Articles | Visual Studio | Visual FoxPro 3-Tier Apps: MSDN Library: "Building Three-Tier Client/Server Applications with Visual FoxPro" ADO MSDN Library: ADO Jumpstart for Microsoft Visual FoxPro Developers John V. Petersen, April 1999 DNA (Distributed interNet Architecture): MSDN On-line: "Top Windows DNA Performance Mistakes and How to Prevent Them" MTS: Microsoft Transaction Server MSDN Library: "Microsoft Transaction Server for Visual FoxPro Developers" ODBC: MSDN Library: "Using Visual FoxPro to Access Remote Data" ODBC drivers are part of MDAC - Microsoft Data Access Components - and are available for download at: "www.microsoft.com/data" VS Installer: MSDN Library: a. "Using Visual Studio Installer for VFP 6.0 Applications" b. "VFP 6.0 and VS Installer Tutorial" VFP General: This is the most complete set of FoxPro links you're likely to find: http://www.cetus-links.org/oo_visual_foxpro.html WEB Development: These products all work well with VFP. WestWind www.west-wind.com FoxWeb www.foxweb.com AFP www.afpweb.com and www.afpages.com X-WORKS www.x-works.com Windows General XML - What's New in XML for Microsoft Windows 2000 See also OLE DB drivers for XML in MDAC 2.6 at "microsoft.com/data" [Contributions solicited. DC] ====================================================================== OTHER STUFF ====================================================================== AUTOMATED TESTING TOOL IN VFP7 [This interesting message was posted on ProFox April 18. DC] Subject: RE: Automated Testing Tool to ship with VFP7?? We are working on one and will make it available, either in the box or on the Web. Not sure which yet. Robert Green Visual Studio Lead Product Manager Microsoft *--------------------------------------------------------------------- THE FUTURE OF VFP For those of you who don't get FoxTalk, there's an encouraging editorial by Whil Hentzen at following link. www.pinnaclepublishing.com/FT/FTMag.nsf/0/ 88A14E9A0110A6C585256A1B007CE140 [yes, that's a 2-line link ] ---------------------------------------------------------------------- METAPHORS, NOT CONVERSATIONS Dan Bricklin (co-author of VisiCalc) has an interesting Webpage, with good comments on the current state of software. Two samples: www.bricklin.com/metaphors.htm Metaphors, Not Conversations Rather than make interacting with the computer act like a conversation with an assistant, make it like a tool you use yourself. www.bricklin.com/assistantfallacy.htm The "Computer as Assistant" Fallacy --------------------------Administrivia------------------------------- This newsletter is a service to all FoxPro developers, provided without charge by the FoxPro Developers Network of San Diego (FPDN). Anyone may subscribe (or unsubscribe) at our web site . The link is on the home page. The Resources button on the website will take you to the back issues of the newsletter. The editor (Dan Covill) is solely responsible for the content. E-mail him with YOUR tips, comments, or complaints. Editor: Dan Covill 858-272-2448 dcovill@acm.org Board of Directors: Eric Lendvai - President 760-734-4929 eric@elsoftware.com Art Bergquist - Vice Pres 760-740-0428 abergquis@cs.com Claude Nikula - Secretary 619-615-6318 crndev@home.com Barbara Peisch - Treasurer 760-729-9607 barbara@peisch.com Dan Covill - Director 858-272-2448 dcovill@acm.org Thad V'Soske - Director 619-544-9900 tvsoske@hanoverdirect.com ----------------------------------------------------------------------