Tuesday, October 23, 2007

News from Southwest Fox, at last!

If, like me, you've been starved for some news out of Arizona at the Southwest Fox Conference, just head over to Steve Bodnar's blog to read some excellent posts. I had been looking around for something, anything from the conference, and the silence has been deafening. Evidently, I was looking in all the wrong places.

I've done conference reporting before (as an official reporter and also as a volunteer contributor to the Universal Thread), so I know it isn't easy to attend conference sessions and also capture some of the essence and publish it for the general Fox public. I had hoped that Southwest Fox would have some official reporters posting daily somewhere but I haven't found any such "official" coverage yet.

If someone knows of such a place, please let me know. Meanwhile, thanks to Steve for helping to fill in the blanks. I really wanted to attend this conference, but a heavy work schedule made that impossible this year. I'm glad to read that the conference was exciting and filled with great information -- and I expected no less than that from organizers Rick, Doug and Tamar.

Next year, Arizona.

Tuesday, October 16, 2007

A Wrong Set Order and a Big Assumption

I'm feeling a little bit embarrased right now, but maybe you'll get a chuckle out of my missteps tonight.

Put these ingredients together and see what you get:
  • A SQL Update statement that has been in operation for over a year with no errors from a .NET application talking to VFP tables via the OLE DB Provider.
  • A VFP reserved word as one of the fieldnames, specifically "order", resulting in "set order = 70" as part of the update statement.
  • Five new fields added to the table and therefore to the update statement in .NET.
  • Update error "syntax error" when testing the Save function with the new fields.
  • A big assumption by the programmer that the problem must be with one of the newly added fields.

Result: Over 2 hours of frustration working in the .NET debugger, stepping through code, checking parameter values being created by my .NET data access code... all the while assuming that the problem MUST be with one of the new fields.

Finally, I tried the complete update statement with values in a simple VFP test program run from the command window. WOW! Syntax error, with the phrase "order = 70" highlighted in the code window.

Another big assumption -- it must be an SP2 beta problem. I wonder if they fixed it in the final release? Let's check on the other computer that still has SP1... oops, doesn't work there either.

Then, the lights went on upstairs, a new day dawned in my brain, and my heart sank.

What if the update statement never really worked at all, even during the year that the application has been in use on the customer's website? It all seems so very logical now, considering that the table being updated is a very static lookup table. The customer has certainly added lots of new categories, but evidently has never had a reason to edit the title or order of any existing categories, so the error went unnoticed until now.

The purest fix would be to rename the field, but that's not going to happen. There are too many pieces of legacy code, including ASP.NET, ASP and Web Connection, that are reading that table right now and I'm not about to upset all of that for a purer approach. When this rewrite is up and live and the old code is gone forever, maybe then I'll go for purity and change the fieldname. But for now, I'll just add the table name in front of the fieldname in the update statement and all will be well -- until the next big assumption bites me!

update categories set order = 70, etc... BAD

update categories set categories.order = 70, etc... GOOD.

I'm going to sleep now with my pride wounded, but with my application past this unfortunate incident.

Friday, October 12, 2007

SP2 Released for Visual FoxPro 9

I was up late working on a project tonight and had a sudden hunch that I should check out the vfoxpro page on msdn.microsoft.com to see if anything was happening with release of SP2 and Sedna.

Bingo! There is now a link for the SP2 final release version and also a new (and very brief) message from Program Manager Milind Lele, where you'll also find a link to the SP2 fixlist.

In a nutshell, SP2 is here, but don't install it over a CTP or Beta verson of SP2. Uninstall those first or you'll be sorry. SP2 requires either the VFP9 Original release version or VFP9 SP1 for a correct installation.

XSource is also coming later and we should see Sedna bits appear sometime soon.

Way to go, Milind and many others who worked on this release. Thanks for all that you have done and continue to do for the VFP community!

Wednesday, June 20, 2007

My client fell through an FOPEN() hole

I got a call from a relatively new online reseller client whose backoffice system was written (by someone else) in VFP. The orders they receive from their Amazon store have to be updated with shipping information and tracking numbers in Amazon's system. This is done when they enter the tracking number into a VFP form and click Save: the form code creates an XML order fulfillment file in a drive-mapped server folder, where it is picked up and sent to Amazon by an automated process.

They were alerted recently to the fact that their order fulfillments were not reaching Amazon, so I dug into the old code to see what the matter might be. Here is the essential code that saves the generated XML into a file:

lfhan = FCREATE(this.xmlfile)
=FWRITE(lfhan,this.xmlstring)
=FCLOSE(lfhan)

Assuming that this.xmlfile = "x:\feeds\orders\_1x3d8sfx.xml" can you guess the problem?

After looking at those three lines of code for a couple of minutes, I realized that the problem could be a missing drive mapping to drive "x" on the computer running the process. Because the code does not check to see if "lfhan" = -1 (problem creating file), the next line calls FWRITE (and doesn't check the number of characters written, which is zero in this case), then FCLOSE does nothing (since there is nothing to close).

No errors show up to the user and weeks pass before the problem comes to the surface.

Because such a complex, automated system was brought to its knees by a simple programmer oversight, I've resolved to "get it right" the first time in my work by coding in anticipation of errors instead of coding by oversight.

Friday, June 15, 2007

Visual FoxPro Sedna and SP2 betas are available

The Visual FoxPro Sedna and SP2 betas are both available for download at:

http://www.microsoft.com/downloads/details.aspx?familyid=05a0e7c9-43c1-417f-8810-ae7d7c66bac8&displaylang;=en&tm

There is a LONG list of SP2 bug fixes in one of the four downloadable files. Although many of them seem to be obsure bugs you aren't very likely to encounter, there are some that sound pretty important or helpful.

One fix that particularly interested me: the ability to change the XMLName property (don't forget to use STRCONV to make the name Unicode) of an XMLTable or XMLField object that is already contained in the Tables or Fields collection when using XMLAdapter.

Previously, we had to get an object reference to the XMLTable or XMLField object, then remove it from the collection, change the name, then add it back to the collection, which of course changed the order of the objects in the collection. This fix is a very nice enhancement if it works (I haven't tested it yet).

So why would you want to change the XMLName property anyway? Either to change the name of the XML tag when creating an XML file from a VFP table or cursor, or to use the XMLNameIsXPath property in conjunction with XMLName to point to a certain place in the XML document (using an XPath statement) when reading from an XML document into a VFP cursor.

So, what's your favorite fix in the list going to be? Take a look and see what's there.

Thanks, VFP Team, for this great package of fixes and enhancements!

Tuesday, March 13, 2007

Major VFP News from Redmond - Good and Bad (Sad)

Alan Griver (YAG) and the Microsoft Visual FoxPro Team announced to VFP MVPs tonight at the MVP Summit several news items related to the future of VFP. There is good news and there is sad news.

1) It's now official -- there will be no VFP 10. This has been known pretty well for some time by all but the most stubbornly optimistic among us, but had never been officially stated by Microsoft. Today it is official.

2) Service Pack 2 (SP2) for VFP9 will be released by the end of Summer, 2007, with a goal of working through as many bugs as possible between now and then. Special focus is on VISTA compatibility and the team needs feedback right away from anyone encountering bugs running VFP9 apps on VISTA.

3) The SEDNA project (the official Microsoft release of VFP9 add-ons) will also be released by the end of Summer, 2007, and it will be FREE! Earlier discussions had hinted that Microsoft might charge for Sedna, but it will instead be available as a free download.

4) The SEDNA project will be released to the community as an open source project, meaning that all of the code included in it will be available for maintenance and enhancement by the community via projects to be set up on CodePlex, the site of the VFPX open source project. Details will be released later about how the SEDNA projects will be managed on CodePlex, but regardless of any future development, you will still be able to download the initial, official Microsoft release of SEDNA as a baseline that will be supported by Microsoft along with VFP9 until 2015.

5) As previously stated, VFP9 will be supported until 2010 in normal support mode and until 2015 in extended support mode. VFP9 will continue to be available as a standalone product for several more years, but the exact date of its discontinuance as a product will be announced at a later date. However, VFP9 will continue to be available in MSDN Subscriptions until the extended support runs out in 2015.

6) The VFP MVP program will continue, so the community will benefit from MVPs with VFP as a specialty.

YAG spent a good part of the day talking with various representatives of the press before meeting with MVPs at a 5pm VFP Team Meeting to explain the news being announced today. YAG's blog contains the only official announcement so far, although the news will appear on the Microsoft VFP site very soon.

Mary Jo Foley, who has written many articles about VFP and Sedna, has written about today's announcement on her blog ("Microsoft to release FoxPro ‘Sedna’ as Shared Source"), emphasizing the open source aspect of the story.

For many of us in the room tonight, it was a bittersweet moment -- being there with VFP team members who are just like family to us and sharing with them some laughs, and also sharing a sense of sadness at the impending end of an era. Sure, VFP support from Microsoft will go on, and the community will continue to support the product, but the finality of no new release from Microsoft beyond SP2 and Sedna is a truly sad moment.

Still, it's extraordinary that the product has morphed and wiggled its way to release after release over the years -- spanning well over a decade under Microsoft's support. That's a long time for any software product. And the the fact that Sedna is being released to the community as a FREE download and also as open source is very good news for every VFP user!

We asked some questions about the VFP Team and their responsibilities, and here's the scoop. The core team and testing team and working hard on SP2 and Sedna from now through release, but by the end of the summer, they will be moving on to other projects for the bulk of their time. There will still be a VFP "alias" for email circulation internally at Microsoft so that if Support Services identify a critical bug that cannot be worked around, the issue can be escalated internally via the email alias and those with VFP C++ experience (namely Calvin Hsia, Aleksey Tsingauz and Richard Stanton) can handle the issues that are escalated up from Support Services.

All three of the core coders named above are already working part-time on various aspects of the VB.NET implementation of the ground-breaking Language Integrated Query (LINQ) feature of the Visual Studio "Orcas" release, and they will likely continue those involvements when the VFP release cycle winds down later this year. Their years of experience working with the integrated data language in VFP will help to make VB.NET's LINQ integration spectacular and very compelling for VFP coders who decide to add .NET to their toolkits.

To all the VFP team members, both present and past: Thanks for all you have done to deliver such a fabulous development product to us year after year. You are all awesome!

Now, back to work. I've got several VFP9 projects underway at the moment, and I expect that to be the case for years to come.

Tuesday, September 12, 2006

Dave Crozier's Prague DEVCON Report

Dave Crozier has just blogged about the first day of the Prague VFP DevCon, with lots of interesting details from Alan Griver's keynote and a few of the first sessions.

You might want to keep an eye on Dave's blog for the next reports.

One of the most interesting parts of the keynote relates to interop between VFP and WinForms, but if you haven't heard much about the details of Sedna yet, you'll learn a lot from this article. (However, Dave's comments about the name "VFP10" may be a bit imaginative -- I think YAG probably just used the term "next release" as Dave noted, but I could be wrong. Time will tell.)

Excellent reporting, Dave. I really appreciate the time you put into this and look forward to the next installment.