====================================== FoxPro Developers Network of San Diego ====================================== FoxDev TipsLetter #00-01 January 03, 2000 Website: Editor: ---------------------------------------------------------------------- CONTENTS: * Calendar * Tech Tips: The ProFox Forum Dan Covill Creating a Private Datasession Ed Leafe * Other Stuff: The Y2.038K Problem Dr. GUI VFP Elevator Speech Consulting Solutions Group * Administrivia ====================================================================== CALENDAR: We alternate meetings between Escondido and Sorrento Mesa. All meetings are at 7:00 pm. Jan. 5 - Escondido ------------------ Dan Covill will present an introduction to XML. This will be an overview, not a code demonstration. Dan will cover how XML came to be, its relationship to HTML, what it's good for, and (some) of what's going on in this fast-moving (and rapidly fragmenting) area. You'll get a list of sources to start your own investigations. Feb. ? - Sorrento Mesa ---------------------- Nick Nikula and Steve Settimi are teaming up to give us an overview of VFP Com Objects and VFP Com Objects running on MTS. [I assume MTS is the Metropolitan Transit System. DC] 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. ====================================================================== TIPS ====================================================================== THE PROFOX LISTSERVE Dan Covill Several months ago Art Bergquist gave us the URLs for a couple of VFP-oriented web sites. I finally found the ProFox site and signed up for the listserve. For those of you who've been on a desert island the last five years, a "listserve" is nothing but an e-mail address list with an automatic "reply to all" feature. Send a message to the list, and it goes to everybody on it. Reply, and the reply goes to everybody as well. Unlike a forum, where you have to go there and look, the e-mail messages come to you. Automatically. Lots of 'em! But you can cancel automatically, whenever you want, so it's up to you. I've been on ProFox for about three weeks now, and talk about your two-edged swords! It probably averages 20-30 messages per DAY(!) - I had to learn to use Eudora's filter mechanism to cope - but the content is a wonder. In this brief time I've gotten a. A way for a distributed application to establish an ODBC connection programmatically on a client machine, nicely packaged as a class, from a guy in Milan, Italy. b. A long discussion on how to get the MTS (Microsoft Transaction Server) sample from the MS website, install it, and figure out why it won't run. For this, you need friends. c. A whole bunch of neat "how to" tips, like the one that follows. d. Endless repeats of lots of things I already knew. e. A never ending list of things I DIDN'T know. ProFox is hosted by Ed Leafe, a developer who is also a regular contributor. Thanks, Ed! ---------------------------------------------------------------------- Creating a Private Data Session Ed Leafe On 12/23/1999 8:50 AM, Andrew Dewey supposedly said: >I want to create a private data session for a class based on custom. >Is there a way to do this, or should I just base the class on a form >and use the form's private data session? If you are using VFP6 SP3, there is a new Session object, whose sole reason for being is to create a private datasession. Create a property called oSession, and in the class Init(), run the code This.oSession = CREATEOBJECT("Session") In any earlier version, you must create a form to get a private datasession. [reprinted from ProFox message with Ed's permission - DC] ====================================================================== OTHER STUFF ====================================================================== THE Y2.038K PROBLEM Dr. GUI from "Dr. GUI's Bits and Bytes", Sept 25, 1998 First it was Y2K. Then the Euro conversion. And now, as if the Y2K and Euro problems weren't bad enough, there's the year 2038 bug. Dr. GUI got a letter from Mahmoud Saleh alerting him (reminding him, actually) of a similar problem that will face C and C++ programmers in coming years: we can call it the Y2.038K bug. The problem stems from the common definition of the time_t as an integer containing the number of seconds since midnight, January 1, 1970. Most C/C++ runtime libraries define time_t as a long int. On most systems, long int is 32 bits, which means that we've got a range of 2^31-1 (2,147,483,647) seconds until sometime on January 18, 2038. (Assuming Dr. GUI's Windows CE Palm-size PC has it right, that's a Monday. Figures.) Since the number is signed, when the clock rolls over the time will be a very large negative number, giving us a time warp of a little over 136 years we'll flip back to sometime late in December, 1901. (Good thing that time_t isn't a 31-bit unsigned number, or it would have been back to the '70s for everyone. You'd have had to get your leisure suits ready 'cuz you'd be catching Boogie Fever and Nixon would be President again. Four more years indeed!) Anything that uses time_t is also in trouble. That includes the time_b structure (not commonly used, anyway) and, very unfortunately, the MFC CTime class. Code that uses time_t, directly or indirectly, will need to be changed sometime before you start dealing with dates after 1/18/2038. (Note that if your program deals with, say, 40-year bonds, you're in trouble today.) Dr. GUI recommends using robust date and time data structures rather than ones based on time_t for all new code and updating existing code as needed. If you program primarily in Visual Basic or Visual J++, you're in luck: Visual Basic's Date data type (the same as the automation DATE, actually) and Java's Date class both go well beyond your program's reasonable lifetime. Visual FoxPro uses a robust date representation as well, although you might have to adjust your program to be Y2K compliant. [However, in VFP6 it's real easy to use an ActiveX control or COM object written in C++, so how do you know?] [Dr. GUI's column appears in the Microsoft Tech Journal - DC] ---------------------------------------------------------------------- A VFP ELEVATOR SPEECH by Harold Chattaway A term my boss uses to describe a sales tactic is the "elevator speech" Meaning, if you were stuck in an elevator with a potential customer for the typical 3 minute ride, what would you say to convince them to use your product? You have to summarize your case in a very powerful, and persuasive manner. Here is a first draft of a VFP elevator speech...It might be a good thing if we could develop a concise and powerful reason as to why someone should use VFP...I believe this is a start in describing VFP's strengths...What do you think? "Visual Foxpro is MS's only data-centric development environment. It is part of Visual Studio, MS's "best of breed" set of development tools. VFP is a true object-oriented language that supports inheritance. Using VFP's native database engine can give your website a substantial performance boost over using ODBC or ADO. Since it is a data-centric language, development time can be considerably less than with general purpose languages. VFP can work just as easily with SQL Server as it can its own database, it is totally transparent. VFP is about data, not DBF's. No matter what the datastore is, you can always realize the benifits of VFP's native cursor engine and OOP language. VFP is a great choice for the middle-tier, data-intensive component of your website..." Possible questions... 1. "Why do I hear more about Access?" Access is a end-user tool that is packaged with MS's other end-user product line, MS Office.It is designed for small single-user desk-top applications. MS Office has many more users then Visual Studio making it much more well known. 2. "I want to use SQL Server not VFP..." Fine, SQL Server can be the data store for VFP. You still need a place to put your business and application logic. Nothing will process the data faster then VFP. (if they can understand the technical side, the COM overhead involved is using ADO could be discussed.) What other points would be good to promote? The objective here should be to provide real economic and sound technical reasons as to why VFP is a good choice... Other possible points: Since VFP has an advanced data-centric, OOP language as opposed to a limited scripting language (ASP), the amount of code that is written is considerably less and much easier to maintain. Scripting languages like ASP are not end- all be-all languages. They are frequently misused and the result is unmanageable applications with many thousands of more lines of code then are necessary. If doing an app that handles data, using VFP can realistically save months of development effort. (Seen it!) ****** This could easily be expanded to include things that haven't been listed here. It could give the VFP community some realistic way of responding to tool choice. Rambling on to a decision maker about how great VFP without real reasons, gets us no where...This might help! If you have any other thoughts that you think should be added, please e-mail them to me and we'll try to update this more than Muzak gets updated on the elevator. Thanks for your time! Harold Chattaway Senior Software Engineer USdatacenters.com hchattaway@usdatacenters.com [From the VFUG newsletter - submitted by Stephen Settimi] [Ed note: He's got a real point here, even if you (like me) might like to change the phrasing a bit. If you send him any comments, e-mail me a copy too, for the newsletter. DC] ---------------------------------------------------------------------- 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 ----------------------------------------------------------------------