====================================== FoxPro Developers Network of San Diego ====================================== FoxDev TipsLetter #01-02 February 5, 2001 Website: Editor: ---------------------------------------------------------------------- CONTENTS: * Calendar * Tech Tips: Set Volume Instead of Path Dan Covill Building an MDB in VFP David Almada ODBC Drivers for VFP Dan Covill * Links: Where Can I Find...? * Other Stuff: FPDNSanDiego.Visible = .T. Dan Covill Cetus-Links Sell Yourself, not Microsoft Stephen Russell Data, Information, and Knowledge * Administrivia ====================================================================== CALENDAR: ****************************************************** ALL MEETINGS ARE NOW IN ESCONDIDO !!! ****************************************************** *** NOTE: NEW MEETING TIME *** ****************************************************** Our regular meetings are now at 6:30 pm, since we have to vacate our meeting place by 9:00. Feb 7 - Escondido ----------------- Nick Nikula will show us how to use Remote Automation Server running in asynchronous mode. March - Escondido (probably) --------------------- Barbara Peisch will discuss some of the basics of using views, the limitations of the view designer, how to build views in code, and the advantages of keeping view in a separate DBC. April - Escondido ----------------- Dan Covill will demonstrate an audit trail mechanism using XML. -------------------------------------------------------------------- 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 ====================================================================== SET VOLUME INSTEAD OF PATH by Dan Covill When your program has to access files in other directories, there are several ways to deal with the path. Here are some of them: a) Hard-code the entire path (Microsoft style!). use D:\Somefolder\Thefile b) Set the path in the VFP path set path to "D:\Somefolder" additive use TheFile This is pretty clean, but dowsn't work if there is a file with the same name in the current directory. c) Use a memvar (global?) to hold the path. cPath = "D:\Somefolder\" use (cPath+"TheFile") Syntax is a bit awkward, and you have remember whether the pathname includes the '\'. But I'll bet most of you don't know about this one: d) Use "set volume" to define a pseudo-drive. set volume T: to D:\Somefolder use T:TheFile Essentially, SET VOLUME is a program version of the old DOS SUBST command (e.b., SUBST T: D:\Somefolder). It's a leftover from VFP Macintosh, and does not appear in the VFP 6.0 help (it is in the Hacker's Guide, however). I like the fact that it's not fussy about delimiters; you don't have to remember whether you included the backslash or not. a. It's syntactically parsimonious, you don't have to build up character expressions inside parentheses. b. It's specific, unlike the "set path". c. It's forgiving, it works whether you include the final backslash or not. The big disadvantage is that it's undocumented. dcovill@san.rr.com ---------------------------------------------------------------------- BUILDING AN ACCESS MDB by David Almada Building an Access MDB from VFP isn't that hard to do.....it's just tricky...from the top: ------------------------------------- DELETE FILE "C:\MyAccessData\Stats.MDB" #DEFINE ACSaveChanges 1 #DEFINE adText 10 #DEFINE adInteger 3 #DEFINE adSingle 6 user = 'joe' calls = 222 sales = 567 perc = 45.67 oAcc=CREATEOBJECT("Access.Application") cMDB="C:\MyAccessData\Stats.MDB" cTbl="UserInfo" oAcc.NewCurrentDatabase(cMDB) oMDB=oAcc.CurrentDB oTbl=oMDB.CreateTableDef(cTbl) oFld=oTbl.CreateField("user") oFld.Type=adText oFld.Size=30 oTbl.Fields.Append(oFld) oFld=oTbl.CreateField("calls") oFld.Type=adInteger && Size not needed oTbl.Fields.Append(oFld) oFld=oTbl.CreateField("sales") oFld.Type=adInteger && Size not needed oTbl.Fields.Append(oFld) oFld=oTbl.CreateField("perc") oFld.Type=adSingle && Size not needed oTbl.Fields.Append(oFld) oMDB.TableDefs.Append(oTbl) oRS=oMDB.OpenRecordSet(cTbl) USE stats IN 0 ALIAS foo SELECT foo LOCATE SCAN oRS.AddNew oRS.Fields("user").Value=foo.user && "Joe" oRS.Fields("calls").Value=foo.calls && 222 oRS.Fields("sales").Value=foo.sales && 567 oRS.Fields("perc").Value=foo.perc && 45.67 oRS.Update oRS.MoveFirst && Required because of weirdnesses in ADO/DAO ENDSCAN USE IN foo oRS.Close oAcc.Quit(ACSaveChanges) RELEASE oAcc ------------------------------------- David Almada, MicroStar Software, Inc. 2245 Camino Vida Roble, Carlsbad, California 92009 760.931.4949 Ext. 1220, davida@microstar-usa.com May The Fox Be With You. ---------------------------------------------------------------------- ODBC DRIVERS Dan Covill "With the Microsoft Visual FoxPro ODBC Driver you can do the following: Use Microsoft Query to query and update Visual FoxPro data from Microsoft Excel worksheets. Create mail-merge letters using Visual FoxPro data with Microsoft Word. Query and update Visual FoxPro views and tables from Microsoft Access. Use Visual FoxPro as the data store for Microsoft Visual Basicr, Microsoft Visual C++r, and C applications." [Who says M$ never mentions FoxPro? DC] ODBC drivers are part of MDAC - Microsoft Data Access Components. The drivers (and lots of other info) are available at: "www.microsoft.com/data" A caution, however: you want MDAC 2.5, as the VFP ODBC drivers have been removed from MDAC 2.6. MDAC 2.6 contains the OLE-DB drivers for VFP, but no ODBC drivers. The VFP driver in MDAC 2.5 is version 4.0.4403.2, and is the version included with Windows 2000. MDAC 2.5 SP1 contains version 4.0.5303.1, which is also included in Windows 2000 SP1. So if you have W2000 SP1 you don't need to install the SP1 for MDAC 2.5. 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" 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 ====================================================================== FPDN.VISIBLE = .T. Dan Covill Thanks to the good work of Thad v'Soske and Eric Lendvai, our website is now visible thru at least one major search engine. Using Google (my favorite), I searched for FoxPro "San Diego" developers Results 1 - 10 of about 488. Search took 0.61 seconds. The first four results were as follows: CEO San Diego ... FoxPro Developers Network of San Diego-- Meeting time: 7 pm, first Wednesday of the month. Call 760-439-6617, option 9; or browse www.foxdevsd.org. ... www.computoredge.com/sandiego/SanDiegoUserGroups.htm - 101k - Cached - Untitled ... The FoxPro Developers Network of San Diego is a non-profit corporation started by a group of FoxPro developers interested in sharing ideas and promoting the ... www.foxdevsd.org/ - 6k - Cached Untitled ... Speaker, Art Bergquist. Speaker Biography, Art Bergquist is the Vice President of The Visual FoxPro Developers Group of San Diego. ... www.foxdevsd.org/meeting_past.asp - 39k - Cached Links to San Diego and international FoxPro Developers, ... ... Peisch, . Links. Whil Hentzen publishes books on Visual FoxPro; FoxPro Developers Network of San Diego www.foxdevsd.org; Information about other user groups and ... www.peisch.com/links.html - 7k - Cached - Similar pages Cetus Links: 18,838 Links on Objects and Components / Visual ... ... Page; Potomac Area Fox UG; Rocky Mountain FoxPro User Group; FoxDev Foxpro Developers of San Diego; Association of Database Developers Foxpro/VFP SIG (San Francisco ... Description: Richard Katz's Visual FoxPro links on Cetus Links. [OK, Art Bergquist got in there somehow, but what the hey... ] [Good job, Thad and Eric! DC] ---------------------------------------------------------------------- CETUS-LINKS And not just because we appear in it, this is the most complete set of FoxPro links you're likely to find: http://www.cetus-links.org/oo_visual_foxpro.html ---------------------------------------------------------------------- SELL YOURSELF, NOT MICROSOFT Stephen Russell What we really have is a marketing situation for ourselves. Can we dynamically market our skills, or must we rely on M$ good graces to justify what we do? Marketing is usually not a skill set that a developer has. Some of us are full of crap so it comes natural. If you need the good press of M$ to substantiate your project hire an agent. If you can sell the quality of [your own] prior deliveries then this is just a waste of time. Stephen.Russell@stjude.org ---------------------------------------------------------------------- DATA, INFORMATION, AND KNOWLEDGE [The following is excerpted from the book "Working Knowledge: How Organizations Manage What They Know", by Thomas H. Davenport and Lawrence Prusak. It was reviewed in the ACM magazine Ubiquity.] "In the end, the location of the new economy is not in the technology, be it the microchip or the global telecommunications network. It is in the human mind." -- Alan Webber KNOWLEDGE is neither data nor information, though it is related to both, and the differences between these terms are often a matter of degree. DATA: Data is a set of discrete, objective facts about events. In an organizational context, data is most usefully described as structured records of transactions. ... Peter Drucker once said that information is "data endowed with relevance and purpose," which of course suggests that data by itself has little relevance or purpose. INFORMATION: Information is meant to change the way the receiver perceives something, to have an impact on his judgment and behavior. It must inform; it's data that makes a difference. ... Strictly speaking, then, it follows that the receiver, not the sender, decides whether the message he gets is really information -- that is, if it truly informs him. KNOWLEDGE: Knowledge is a fluid mix of framed experience, values, contextual information, and expert insight that provides a framework for evaluating and incorporating new experiences and information. It originates and is applied in the minds of knowers. ... Knowledge derives from information as information derives from data. If information is to become knowledge, humans must do virtually all the work. www.acm.org/ubiquity/book/n_dixon_1.html --------------------------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 nikula@worldnet.att.net 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 ----------------------------------------------------------------------