====================================== FoxPro Developers Network of San Diego ====================================== FoxDev TipsLetter #00-06 June 02, 2000 Website: <====NEW!==== Editor: ---------------------------------------------------------------------- CONTENTS: * Calendar * The WebSite is Up! * Newsletter News * Tech Tips: TaskInfo Utility Dan Covill Comment on Debugging Reports John Overland Where Should We Put Code? John Peterson Where Do I Find...? * Other Stuff: VFP Training in San Diego Stephen Settimi VFP7 - New Features Nick Nikula ADO Jumpstart John Peterson ADO = ADSLOW Harold Chattaway Flying Pigs and Outlook Consulting Solutions Group * Administrivia ====================================================================== CALENDAR: We alternate meetings between Escondido and Sorrento Mesa. All meetings are at 7:00 pm. (We were hoping we would be able to meet in Solutions Consulting Group's new conference facilities this month, but construction isn't complete yet. We're aiming for August.) June 7 - Sorrento Mesa ---------------------- Tim Daly will be showing us some OLE automation. July 5 - Escondido ------------------ This meeting was originally going to be a tips and tricks session. But, we've been contacted by the Orange County group, and they would like to have a speaker exchange. For July, Mike Vincent will come down and speak about n-tier development. Eric and Barbara will be going to the Orange County group on July 12. More details at our next meeting. August 2 - Sorrento Mesa ------------------------ Board member Dan Covill will be presenting ways to package your code, to reduce the number of files in your apps and make them easier to document and maintain. Sept 6 - Escondido ------------------ Board member Barbara Peisch will be talking about using Steven Black's INTL toolkit for creating multi-lingual apps, with a special emphasis on his Message Service and alternatives. Oct 4 - Sorrento Mesa --------------------- Board member Art Bergquist will show us how to use dynamic controls in a grid. 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). Sorrento Mesa meetings are in the PS Business Center, 6450 Lusk Blvd. From the Lusk Blvd driveway, go straight back to the furthest corner of the rear bldg and park. The conference room is upstairs over the Fitness Center. ====================================================================== HOT NEWS ====================================================================== THE WEBSITE IS UP! Our new, redesigned website is up at . And yes, that's our own domain name as well. Check it out. The site includes text of all these newsletters from 1998, so if you want to look for something, there it is. Thanks to Eric for hosting it and all his work on it. [DC] ---------------------------------------------------------------------- NEWSLETTER NEWS At our May meeting, the Board decided that the (this) Newsletter would serve us better by not being restricted to members. By allowing anyone to subscribe, it can be both a public service to the FoxPro community and a general publicity vehicle for our organization. In the near future it will be possible for anyone to subscribe (or unsubscribe) through the website. We'll let you know. The individual listings on the website are still for members only. [DC] ====================================================================== TIPS ====================================================================== TASKINFO UTILITY by Dan Covill If you have wondered, as I often have, where all that crap came from that's always running in your system, I have a neat utility for you. It's called TaskInfo, and it's a shareware program by a Russian who writes video device drivers for a living. His name is Igor Arsenin and his Site is It runs on Win 9x, NT and 2000, and combines the NT Task Manager output with Win 98 System Info and a lot more. The neatest thing to me is that, for every task and thread running, it gives you the path and name of who it belongs to! Absolutely amazing how many separate processes McAfee Anti-Virus thinks it needs. The real vs virtual memory info is invaluable by itself. This guy is good! It's a 350k download, and doesn't even have to be installed, you can just run it. Like most shareware, 30 days free, then only $12 and well worth it. (If you try it, tell me what you think.) ---------------------------------------------------------------------- Comment on DEBUGGING REPORTS by John Overland Re: DEBUGGING REPORTS (May FPDN Newsletter) Barbara - Good report debugging tip. I might add to the last part about the Modify Report command. The VFP system menu bar can also help. Place before the Modify Report command the "SET SYSMENU TO DEFAULT". This will get you back even more into the development mode. Thanks - John Overland ---------------------------------------------------------------------- WHERE SHOULD WE PUT CODE? John V. Peterson [This is an excerpt from an article on John Peterson's web site. Read the whole thing at . DC] I never put code in the click event of a button or any method of any control if I am not in a hurry because it is only the purpose of these controls to maintain a good interface and to trigger code. The controls are unified by the form container so I place the code into custom methods of the form if the code is simple onetime functions. So a button that runs a report will have only one line. thisform.doreport. Then in the doreport method I will have code for making sure the user wanted to run this report, code to display info about the completion of the report, some code for printing options, but I will not put any major data control here, but for a line like thisform.fillcursor. Fillcursor will create a cursor, and run a loop driven by the table with most of the info and the right number of records. In the loop I will position involved tables, and create one record in the cursor for each record of the driving table. ---------------------------------------------------------------------- WHERE CAN I FIND...? 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" VS Installer: MSDN Library: a. "Using Visual Studio Installer for VFP 6.0 Applications" b. "VFP 6.0 and VS Installer Tutorial" Windows General XML - What's New in XML for Microsoft Windows 2000 [Contributions solicited. DC] ====================================================================== OTHER STUFF ====================================================================== VFP TRAINING IN SAN DIEGO by Stephen Settimi I'm puttin on a two day VFP training session in San Diego, June 29th - June 30th. The training is targeted to "New-to-VFP" programmers and other intermediate programmers interested in learning the nuances of the programming language, some new techniques and the inside workings of VCXs, project manager/hook, etc. There will be two 1/2 day and one 1 1/2 day sessions. Anyone interested in attending should refer to: ---------------------------------------------------------------------- VFP7 - NEW FEATURES by Nick Nikula If you have not gone to this link yet you have to. It is all about VSS 7 and VFP 7. ---------------------------------------------------------------------- ADO JUMPSTART from "The LA Fox Developer" The LA Fox Developer newsletter has been running a multi-part article by John Peterson on the fundamentals of ADO and how to use it in VFP. It's much too long for me to insert here, but you can read/print it yourself from the MSDN library. Here's the info: ADO Jumpstart for Microsoft Visual FoxPro Developers John V. Petersen April 1999 Summary: Provides Microsoft Visual FoxPror developers with an overview of ActiveXr Data Objects (ADO) and shows how to incorporate ADO into Visual FoxPro applications. Discusses the ADO object model and implementing Remote Data Services (RDS). (52 printed pages) Contents: Introduction What are OLE DB and ADO? Why Incorporate ADO into a Visual FoxPro Application? ADO Object Model Remote Data Services Summary Introduction: "ActiveX Data Objects (ADO) is perhaps the most exciting new Microsoft technology in quite some time. Because ADO is concerned with data, this new technology is of particular interest to Microsoft Visual FoxPro developers. Of course, you may ask, "Why do I need ADO? Visual FoxPro already has a high-performance local data engine." It's a good question." [John also has some interesting and useful tips on his own website. Check it out at . DC] ---------------------------------------------------------------------- ADO = ADSLOW by Harold Chattaway from "The LA Fox Developer" ADO/ASP vs VFP COM Component Benchmark These benchmarks should prove useful when comparing the relative speed differences between manipulating data in ASP/ADO and using a VFP COM component that is instantiated from an ASP page. The datasource for both the ADO/ASP and VFP COM component was a SQL Server 6.5 table. There were NO DBF files utilized for these tests. The data table has 1026 records with 21 fields for a record length of 116. The first table below uses the same technique for both ADO/ASP and the VFP MTDLL. A string is concatenated together that represents the complete HTML table. As you will see, the ADO/ASP combination performs very poorly. This method in ASP is not a viable option. The second table shows the times for ADO/ASP when the RESPONSE object is used to send each piece of the HTML table directly to the output stream. In this test, ADO/ASP performs much better. String concatenation is not the preferred technique. This table shows the times for ADO/ASP and a VFP MTDLL to perform the same task. They are both taking a table with x number of records and converting them into an HTML table. The cursor that is used by VFP is a VFP View onto the same SQL Server table that is used by ADO/ASP. These times do not include the time to retrieve the data from SQL Server. This is the elapsed time between the time the cursor processing loop is entered and the time it is left. It is concatenating together a string that represents the complete HTML table... Table 1: # records Time ADO/ASP Time VFP MTDLL Speed Increase 50 <1 .05 - 100 1 .09 5.88x 150 3 .18 16.6x 200 4 .22 18.8x 300 14 .34 41.1x 400 29 .46 62.9x 1029 timed out 1.11 - As you can see, the times slow down drastically as the record count goes up for ADO RS. This is a very non-linear relationship. The third column in the above above table shows a much more linear relationship with regard to VFP's performance. On 400 records, VFP is 62 times faster then the same operation in ADO/ASP using string concatentation. This next table shows the times for ADO/ASP to produce an HTML Table from a ADO RS using the RESPONSE object. These times are much better then in the above test, but still much slower than the VFP MTDLL approach. Table 2: # records Time ADO/ASP Time VFP MTDLL Speed Increase 50 .393 .05 7.66 100 .756 .09 8.4 150 1.081 .18 6 200 1.455 .22 6.61 300 2.185 .34 6.4 400 2.851 .46 6.18 1029 7.361 1.11 6.61 The next test was taking an ADO recordset from ASP and passing it to the VFP COM component. The receiving function then converts it into a VFP cursor using VFPCOM.DLL. It then processes the cursor as in the above test. This was done as a practical matter to see if an existing ASP app that uses ADO recordsets could benefit from this approach. The COM component was able to be plugged into the page utilizing an existing ADO RS. Passing this RS to VFP and allowing VFP to manipulate it, proved to be a trivial task. This allows for retaining logic in the ASP page and utilizing VFP for performing the data processing steps. Table 3: # of records Time in seconds 1026 record ADO recordset 1.11 to VFP COM MTDLL from ASP Page Total time from ASP side to pass 3.47 and receive back result including conversion of RS to VFP cursor An important point to be taken from this is that this type of data processing can be done around 6 - 7 times faster using VFP. If if the data is originally in an ADO Recordset, it can still be this much faster to pass the recordset object to VFP and have the VFP program handle it from there. The biggest reason for this is the overhead involved in making COM calls using ADO. To loop through a 100 record table with 10 fields and produce an html table, requires 1200 COM Calls! Each row requires 10 COM calls to access the field * 100 rows. Plus there is a COM call to do a MOVENEXT at the bottom of the loop and a check at the top of the loop for EOF. That is 200 more COM Calls. In VFP, there are no COM calls at all to do the same processing. There is just the initial call to the VFP function from the ASP page. Virtually any web-site could take advantage of the VFP speed improvements regardless of the data source. VFP provides this improvement even for non-dbf file formats! Harold Chattaway ---------------------------------------------------------------------- DANCING PIGS AND OUTLOOK Given a choice between dancing pigs and security, users will pick dancing pigs every time. - Ed Felten of Princeton University in testimony before Congress on the Love Bug I'm on record as saying that Outlook is a security hole that also happens to be an e-mail client. - Steven J. Vaughan-Nichols in testimony before Congress on the Love Bug ---------------------------------------------------------------------- SOLUTIONS CONSULTING GROUP Solutions Consulting Group, at 6540 Lusk Blvd, is the host for our Sorrento Mesa meetings. But who are they, and what do they do? "Since its inception in 1993, Solutions Consulting Group has grown to more than 40 employees with over 65 active clients throughout Southern California. We are a Microsoft Certified Solution Provider Partner and a member of the Oracle Business Alliance Program." They do: Corporate Application Development Data Warehousing Network Services They work in FoxPro, VFP, VB, Access, SQL, and Oracle. They are looking for more employees and they do use contractors as well; contact Armando Andrade at if you're interested. For More Information... --------------------------Administrivia------------------------------- This newsletter is a service to members of the FoxPro Developers Network of San Diego (FPDN). The editor (Dan Covill) is solely responsible for the content, Barbara Peisch does the distribution. E-mail the editor YOUR tips, comments, complaints, and rebuttals. Editor: Dan Covill 858-272-2448 Board of Directors: Eric Lendvai - President 760-734-4929 Art Bergquist - Vice Pres 760-740-0428 Claude Nikula - Secretary 619-615-6318 Barbara Peisch - Treasurer 760-729-9607 Dan Covill - Director 858-272-2448 Thad V'Soske - Director 619-544-9900 ----------------------------------------------------------------------