Special Edition Using Visual FoxPro 6
Special Edition Using Visual FoxPro 6
- About the Authors
- What is Visual FoxPro?
- But Isnít Visual FoxPro Dead?
- What If I Have Old FoxPro Applications?
- Who Should Read This Book?
- Conventions Used in This Book
- Tell Us What You Think!
Menachem Bazian, CPA, is director of Client Services for
LNW Consulting Services, LLC, a Business and Technology Consulting
Firm based in New York City. Menachem has been a developer and
consultant for 13 years. He is an internationally known expert
on object-oriented analysis, design, and development and has lectured
extensively on the subject. He also possesses expertise in business
process analysis and redesign, which he uses regularly in the
service of his clients. Menachem has spoken frequently at conferences,
including the FoxPro and Visual FoxPro Developer's Conferences
from 1990-1998, various regional FoxPro conferences across the
U.S. and Canada, the Foundation for Accounting Education, The
N.Y. State Society of CPAs' annual accounting and computer shows,
and others. He has written for many magazines, including Databased
Advisor (now e-Biz Advisor), FoxPro Advisor, New
Accountant, and more.
Jim Booth is a Visual FoxPro developer and trainer. He has written articles for the major FoxPro journals and has spoken at conferences in North America and Europe. He has been the recipient of the Microsoft Most Valuable Professional Award every year since its inception in 1993. He is married and the father of three boys, and wishes he could program them as easily as Visual FoxPro. His house is also populated with two dogs, a cat, a fish, and a bird.
Jeb Long has 35 years experience in software design and engineering at some of the most prestigious technical organizations in the country. Since leaving Ashton-Tate Corporation in 1990, he has worked as an independent consultant and author, and has written technical documents, several books, and articles for technical journals. While at Ashton-Tate, he was the dBASE language architect and was responsible for the dBASE language components for all versions of dBASE III and IV, except for the initial version. During 14 years at the California Institute of Technology's Jet Propulsion Laboratory, he was responsible for software tasks in support of our nation's planetary exploration program. Among these tasks were programs to calculate interplanetary trajectories, to process telemetry from space vehicles, to simulate spacecraft propulsion subsystems, and to support spacecraft tests and operations. He was actively involved in the Mariner and Viking Missions to Mars. He and his wife Elizabeth, a technical writer who works closely with Jeb in writing all of his books, now live on a hill over-looking Los Angeles.
Vin Miller is a Senior Analyst at InvestLink Technologies, a New York City-based software development firm providing database, Internet, and telephony solutions for the defined contribution industry. He has programmed in FoxPro since 1990. He is the co-author of Family Planning and Population: A Compendium of International Statistics, as well as several scholarly articles on international demographics and research methods.
Ceil Silver has been in the computer industry since 1967, first as a COBOL and RPG programmer, and from there filling many corporate positions involving applications software development, systems software support, and software project management. She has been an independent consultant in the NYC metropolitan area since 1989, specializing in database applications and systems analysis for a variety of industries. Her current development tool of choice is Visual FoxPro. She is also founder of the Westchester FoxPro of PADD (Professional Association of Database Developers), in Westchester County, NY.
Robert A. Byers is a nationally recognized authority on database management systems for microcomputers. He is currently a partner in Balleisen-Byers, a developer of client/server database products for desktop computers. A former manager of the Mission Control and Computing Center at the Jet Propulsion Laboratory in Pasadena, California, Mr. Byers has held numerous positions of responsibility in the computer and communications industries over the past 32 years. He has served on several government advisory panels for Communications and Data Handling, including the select panel on Data Handling and Avionics for the Space Shuttle and NASA's Planetary Data Systems Working Group. He was actively involved with the development of dBASE, and often acted as a spokesman for Ashton-Tate prior to their purchase by Borland. He has served as an independent consultant on microcomputer software to several major corporations, and has developed vertical market applications software for the medical and retail business communities. The author of numerous technical papers and several best-selling computer books, he also holds a U.S. patent on Distributed Signal Processing. His Everyman's Database Primer became a standard and was translated into several languages. An engineer by training, he has a B.S.E.E. from California State Polytechnic University at San Luis Obispo, M.S.E.E. from Georgia Institute of Technology, and has done additional post-graduate work in Communications Theory at U.S.C. He has been employed by Ampex Corporation, Bell and Howell, the Georgia Tech Research Institute, and JPL.
Writing a book is a bear of an undertaking, not only for the author but for those around him. Mere words cannot do justice to the effect these people have had on me, either through technical assistance or moral support. Still, words are all I have.
First of all, to the incredibly talented team of people at my new firm, Levine Mandelbaum Neider Wohl, LLP. To the partners, Mark Levine, Jay Neider, and Lester Wohl; to Glenn Davis, Michael Giller, Tery Gingold, Valerie Jaraique, Carol Lechner, Katherine McCoy, Renee Neil, and Joe Vecchio. Thank you for welcoming me into your firm and showing trust in me. I enjoy working with you all.
To David Lazar, Robert Green, Jim Saunders, Susan Graham, Randy Brown, Calvin Hcia, and so many people on the Microsoft Fox team. You guys created another super winner here. Thanks.
To my incredible editors at Que. To Angela Kozlowski and her merry crew, thanks for being so understanding and for working with me.
To David Blumenthal, Yair Alan Griver, Lior Hod and everyone at Flash Creative Management. Thank you for 6 1/2 fascinating years. Oh, and to Chushie (What's the count now, Alan?).
To the people in the Fox community I have had the pleasure of knowing and working with: Pat Adams, Steven Black, Jim Booth, Chaim Caron, Barr y Cunningham, Sue Cunningham, Doug Dodge, Mike Feltman, Tamar Granor, Doug Hennig, Nancy Jacobsen, Jim Korenthal, John Koziol, Barr y Lee, Ken Levy, Patrick Logan, Valid Matisons, Paul Maskens, Michael Meer, Andy Neil, John Petersen, Rod Paddock, Alan Schwartz, Ceil Silver, Drew Speedie, Toni Taylor-Feltman, and many more. There are so many of you that I cannot mention you all, but you all have had a special place in helping make my work possible and fun.
Once again to my friend and mentor, Martin Star. I can never say thank you enough for all you have taught me. How'm I doing, Marty?
To Chaim Wasserman. For once words fail me. I have no idea what I could say that would be appropriate for all the times you have been there throughout the years. "Thank you" seems pitifully inadequate, but it's all I have.
To Mark and Meryl Berow and Marc and Judith Stoll. Together we have shared much happiness and adversity. I couldn't imagine having better friends. Thanks.
To Mordecai and Charlotte Glicksman, and their twins, Chana Tova and Elisheva. Thanks for sticking with me over the years. We've come a long way together and I look forward to sharing with you for a long time to come.
I leave for last the people who mean the most to me. To my father, Murray Bazian, and my brothers, Ben and Sol. Thanks for all your advice and help. Even if I don't say it enough, I appreciate it.
To my beloved wife, Anna: Once again you had to put up with a book and you did it with remarkable aplomb. I know that this is never easy on you and I appreciate your support.
To my incredible twins, Barr y and Sam. Somewhere along the line, when God was handing out blessings, he looked at your mother and me and decided that we should have you. I don't know what I did to earn it, but I thank him every day for both of you. Over the years I have laughed with you and cried with you. But, above all, I have watched with neverending awe and amazement, as you have grown into two strapping young men from the little infants I worried over in the neonatal intensive care unit. Your wit, charm, and intelligence are a constant source of joy to me. Now, if only I can get you guys to do your homework and go to bed on time, life would be almost perfect :).
Finally, to Isaac. You are much too young to read this now. Still, in a few years when you have grown a little and learned to read, perhaps these words will have some meaning. You entered our lives and have turned life into a neverending series of new experiences. Neither your mother nor I ever really imagined that a baby could change our lives quite as much as you did but I can tell you that all of us, your big brothers included, bless the day you decided to join us. You have taught us a lot, believe it or not. I look forward to each and every day with you.
I would like to thank all of the people who frequent the electronic forums for Visual FoxPro. Their questions have motivated me to investigate aspects of Visual FoxPro that I may never have looked into on my own. Special thanks go to John Petersen for his insights and assistance. Additional thanks go to Menachem Bazian for his guidance and inspiration during the writing of this book.
Grateful acknowledgment is extended to all the people who made this book possible with their enthusiastic support and encouragement, including the MCP Editorial and Publishing staff, with special gratitude to Angela Kozlowski, Bryan Gambrel, Chris Haidri, and Dallas Releford. To Elizabeth Long-thanks for all your editorial assistance and encouragement in developing and preparing the chapters for this book.
My thanks go out to the members of the far-flung electronic FoxPro community who have made up my virtual office for the past ten years. The online associations, made primarily through CompuServe's FoxForums, have provided a major source of continuing education and professional feedback, leading to ongoing real-world friendships.
Welcome to Using Visual FoxPro 6, Special Edition! This book is your guide to the exciting world of working with the latest release of Microsoft's award-winning database product, Visual FoxPro.
Visual FoxPro has a long and illustrious history as the most flexible and powerful database application on the market. Starting from its origination as Fox Software's FoxBASE product, "Fox" (as it's known among its international community of developers) has always been known for its reliability, speed, and effectiveness as a programmer's database product.
This book is designed to take you into the world of Visual FoxPro. Whether you're a beginner, intermediate, or advanced user, this book has what you need to strengthen and improve your development efforts.
Don't laugh, it's not that silly a question. FoxPro has changed radically over the years. It's not a bad idea to take a little time and review how it has gotten where it is. This will give you additional perspective on the product you're now reading about.
Back in the "old days" (the late 1980s), FoxBASE was intended to be a dBASE clone. If dBASE did it, FoxBASE would do it better and faster (or at least that was the idea). Although FoxBASE had some revolutionary features in it, it was not really intended to be revolutionary; it was designed to be better and faster and, above all, compatible with dBASE III.
FoxPro 1.0 was the first departure from the compatibility dance with dBASE. It began to introduce some new concepts in GUI design and ways of developing software that put it ahead of the by-then floundering dBASE.
FoxPro really came into its own with version 2.0. When FoxPro 2.0 was introduced, several key technologies were included that revolutionized the PC database development market:
- The addition of Rushmore did the unthinkable. All of a sudden, tables with millions of records were not only possible but feasible in a PC database system without moving to other, more expensive, technologies. I distinctly recall Dr. David Fulton, the founder of Fox Software, demonstrating searches on a table with over a million records that completed in a fraction of a second. The crowd went wild, and a new era was born.
- SQL statements were another revolution introduced in version 2.0. For the first time, Fox developers were using single statements that replaced entire procedures. SQL was, and still is, the language of data.
- FoxPro 2.0 also introduced a somewhat WYSIWYG means of developing reports and screens with the addition of the Screen and Report Designers. The Screen Designer generated code, but definitely enabled a new and exciting way of developing GUIs in a text-based environment.
I could go on and on, but you get the idea. FoxPro 2.0 was the real advent of the exciting capabilities you have today in Visual FoxPro. GUI design services, SQL, and lightning-fast data access were its hallmarks.
Windows support was added in FoxPro 2.5. Support for Dynamic Data Exchange came along for the ride, but as anyone who was around in those days will testify, the Windows version of 2.5 had the look and feel of a DOS app made to look "windowsy."
The next major revolution had to wait until the release of Visual FoxPro 3.0. Once again, FoxPro, now in the hands of Microsoft (which bought out Fox Software during the development of FoxPro for Windows), revolutionized the database development world. Version 3.0 added a host of long-awaited features and took the PC database development world by storm. Here are just a few of the features added in 3.0:
- The Database Container, also known as the DBC, added support for stored procedures, data rules bound to tables, and a host of additional data functions that Fox developers had been anticipating for years.
- Views, which are updatable SQL cursors, added a whole new method of accessing data for processing, GUI representation, and reporting. Two types of views were supported, local and remote views. A local view is a view based on Visual FoxPro tables. A remote view is a view based on any ODBC data source, including SQL Server, Oracle, Access-you name it. This revolutionary addition made Visual FoxPro the premier tool for accessing remote and local data. For all intents and purposes, creating enterprisewide applications and using data stored in remote data sources became almost as easy as using Visual FoxPro tables themselves.
- A full, robust implementation of object orientation turned the development paradigm on its ear. A robust object model and the capability to create your own classes and subclasses created an entirely new way of developing software.
Version 5.0 was an upgrade of 3.0 and contained a lot of bug fixes and some interesting new features. The capability to use and create COM servers (a topic covered in-depth in Part V of this book) was introduced. Some additional commands and functions were added and you saw the beginning of support for publishing Visual FoxPro on the Internet. But 5.0 was not a radical departure from 3.0.
Version 6 is not a radical change either, but some of the changes to the product are momentous. Access and Assign methods (covered in Part IV of this book) introduce a new dimension to controlling data placed into your objects. The new Component Gallery and Foundation Classes ease your transition into creating object-oriented applications. Better COM support is probably one of the more significant changes, enabling easier and better creation and implementation of COM servers. Finally, as the clock continues to tick toward the end of the millennium, improved Year 2000 support is a welcome addition, as well.
Okay, here's the bottom line. Visual FoxPro is the premier development product for creating mission-critical, enterprisewide, object-oriented, client/server applications designed for local or global deployment.
Frankly, I'm getting really tired of hearing that question. I have been hearing it for years now. Visual FoxPro is not dead, it is very much alive and thriving. Despite what you might hear from some rumormongers, Visual FoxPro is the best product, even in the Microsoft suite, for developing database applications. Let's face it: Visual FoxPro was designed, from its inception, to handle data. It is fast, powerful, and flexible.
This doesn't mean that Visual FoxPro's role in application development is not ever going to change. Some change is already in motion. The world is beginning to move away from monolithic, single-tiered applications to multi-tiered (n-tiered) applications, as explained in the COM section of this book. Visual FoxPro is a natural for the middle (business rules) tier in a multi-tiered application.
As part of the Visual Studio product suite, Visual FoxPro is now part of a technology team for creating enterprise-wide solutions. The days of an application written only in Visual FoxPro (or Visual Basic for that matter) are numbered. As browsers such as Internet Explorer gain more intelligence, GUI front ends are going to be ported to browsers for a host of reasons. The back-end datasource will be whatever it is (Visual FoxPro, SQL Server, Oracle, or whatever). Sitting right in the middle will be our old friend, Visual FoxPro.
So, here's the deal. If you want to develop a premier application and maintain your investment for the future, Visual FoxPro is a great way to go.
Your old applications should run unmodified under Visual FoxPro. Of course, you'll need to test this out, but that's the party line. In terms of upgrading an older FoxPro application to Visual FoxPro, you have three options:
- Continue coding the old way. You can do this, to be sure, although once you modify a screen, Visual FoxPro automatically converts it to a form. If you do this, though, why bother upgrading to Visual FoxPro? You might as well stay with 2.5 or 2.6.
- Upgrade piece by piece. This is a fairly popular method. As pieces of old systems need modification, you have an opportunity to upgrade each piece to the new technology of Visual FoxPro-even if that just means redoing the forms. This method has the benefit of incurring the least one-time cost (that is, the cost is spread out over multiple modification passes). The downside is that you do not gain as great a benefit from the object orientation offered by the latest version of VFP and you end up with a hybrid system for a while (part FoxPro 2.5/6 and part Visual FoxPro).
- Rewrite the whole thing. Not a bad idea, if you can afford it. In fact, taking an existing system and rewriting it in Visual FoxPro is a wonderful learning opportunity. Presumably, you have most of the requirements worked out already. You can just start with the object-oriented analysis and design and work it through to development. When you're finished, you'll have worked out many of the bugs in your development process, developed a host of reusable objects, and have a definite measure of success to work with. You'll be ready to take on the world with Visual FoxPro.
The downside to totally rewriting, of course, is that it's the costliest approach. A great deal of time is spent doing tasks that have already been done.
So, now that you know where Visual FoxPro fits in with the development world, it's time to examine what you can do to bring yourself quickly up the learning curve, and what you can do about upgrading your existing systems to Visual FoxPro (if you have a mind to).
Will Using Visual FoxPro 6, Special Edition help you in this process? The answer is a resounding yes! (Did you expect any other answer from the introduction to the book?) Seriously, Using Visual FoxPro 6, Special Edition is the book for you if you are:
- A power user
- An intermediate Xbase developer
- An ambitious newcomer to the Visual FoxPro world who wants a comprehensive reference you can count on for excellent coverage of all aspects of the product
The book is also chock-full of practical routines and tips and tricks on using Visual FoxPro to its fullest as a development tool for mission-critical, object-oriented, client/server applications.
Are you ready to journey into the exciting world of Visual FoxPro? Then sit back, strap yourself in, and read on.
This book uses various stylistic and typographic conventions to make it easier to use.
When you see a note in this book, it indicates additional information that may help you avoid problems or that should be considered in using the described features.
Tip paragraphs suggest easier or alternative methods of executing a procedure. Tips can help you see that little extra concept or idea that can make your life so much easier.
Cautions warn you of hazardous procedures (for example, activities that delete files).
As the reader of this book, you are our most important critic and commentator. We value your opinion and want to know what we're doing right, what we could do better, what areas you'd like to see us publish in, and any other words of wisdom you're willing to pass our way.
As the Executive Editor for the Database team at Macmillan Computer Publishing, I welcome your comments. You can fax, email, or write me directly to let me know what you did or didn't like about this book-as well as what we can do to make our books stronger.
Please note that I cannot help you with technical problems related to the topic of this book, and that due to the high volume of mail I receive, I might not be able to reply to every message.
When you write, please be sure to include this book's title and author as well as your name and phone or fax number. I will carefully review your comments and share them with the author and editors who worked on the book.
Macmillan Computer Publishing
201 West 103rd Street
Indianapolis, IN 46290 USA
© Copyright, Macmillan Computer Publishing. All rights reserved.