Archive

Archive for the ‘Uncategorized’ Category

Aug
18

One of my customers who is a developer described a form he built with the following scenario:

  1. Private Datasession, single DBF table
  2. Load event method opens the table and runs a SQL-Select of all the records into a cursor
  3. Display of the records in the cursor in a grid. Grid RecordSource is the name of the cursor.
  4. Observes the data change in the grid when users are changing the data in the base table on other machines in the office.
  5. There is not code to rerun the SQL-Select, and no timers on the form.

His question to me is: how the heck does this happen? Good question.

His assumption was that the cursor data was stagnant since he queried it from the base table into the temporary cursor. Initially I agreed with him and we both thought we were going crazy, but then I remembered something I observed many years ago.

When you perform a SQL-Select and the VFP data engine determines it can be Rushmore optimized, behind the scenes VFP creates a new workarea, which is the same as the open table in another workarea via the USE AGAIN, and applies a Rushmore optimized filter to the new workarea. In essence, the cursor is really passing through the raw table information in the grid he used to display the data. So changes made to the table by the other users in the system are reflected in the grid based in the settings of SET REFRESH.

At first we thought we were nuts, and I had to step through the debugger to ensure the grid was really bound to the cursor and not directly to the table.

One way to avoid this gotcha is to use the INTO CURSOR …. NOFILTER clause on the query. It will slow things down a bit since it is forcing the cursor to be written to disk, but you will not get the filtered table, you get a real stagnant cursor.

Hopefully you will remember this situation if you run into the weird and maybe unexpected behavior.

Aug
15

Kevin posted the tentative schedule for the FoxForward conference. Looks like a good schedule with three simultaneous sessions and several repeated sessions. No time better than today to tell Kevin you want to go to this conference and get registered.

Only 24 days until the conference kicks off in Hotlanta!

,

Aug
15

I was getting creative this evening with the VFP Session class. I was getting tired of changing the DataSession each time I created a private DataSession with the following code:

loSession = CREATEOBJECT("Session")SET DATASESSION TO (loSession.DataSessionId)

So I created a class in a program and added this code to the Init() of the Session class:

SET DATASESSION TO (this.DataSessionID)

This does not work, the DataSession stays with the current DataSession. So I created a custom method in the Session class and called the method externally. Same result. Here is my test program:

LOCAL loSession as Session

?"--------------"?"Should be default DS 1: ", SET("Datasession")

loSession = CREATEOBJECT("Session")SET DATASESSION TO (loSession.DataSessionId)

?"Should be DS > 1: ", SET("Datasession")loSession = .NULL.

?"Should be default DS 1: ", SET("Datasession")

* Now work with a customized session classloSession2 = CREATEOBJECT("pssSession")?"Would think this would be DS > 1 after set in " +; "Init(): ",; SET("Datasession")

loSession3 = CREATEOBJECT("pssSession")loSession3.SetSession()?"Would think this would be DS > 1 after set in " +; "Init() and custom method: ",; SET("Datasession")

loSession2 = .NULL.loSession1 = .NULL.

?"Should be default DS 1: ", SET("Datasession")

RETURN

*************************************DEFINE CLASS pssSession AS Session

DataSession = 2

PROCEDURE Init * Does not set the datasession to the * private DataSession, why? SET DATASESSION TO (this.DataSessionID)ENDPROC

PROCEDURE DestroyENDPROC

PROCEDURE Error(nError, cMethod, nLine)ENDPROC

PROCEDURE SetSession * Does not set the datasession to the * private DataSession, why? SET DATASESSION TO (this.DataSessionID)ENDPROC

ENDDEFINE*: EOF :*

In my mind it should work and for some reason I could not explicitly understand why it does not. Then it hits me, the object is created in the current DataSession, thus when code returns from the Session object back to the calling program, VFP is automatically returning to the current DataSession. This is a common trap I see developers falling into when debugging code that is changing data in an object that was created in the VFP Default DataSession (DS 1). Not exactly the same thing, but very similar. Tonight I fell into the trap.

I proved this was the case by adding code in the Init and SetSession methods to display the current DataSession after the switch, and the DataSession is getting set in code, then reset when returning to the calling code.

Now I understand why I always use the following code when creating and moving to a private DataSession:

loSession = CREATEOBJECT("Session")SET DATASESSION TO (loSession.DataSessionId)

Maybe this will save you an hour of frustration down the line.
(edited to make sure code word-wrapped for visibility)

Aug
13

I am very happy to announce F1 Technologies is officially a Gold sponsor of Southwest Fox 2007, and is making a very generous offer to each and every registered attendee of Southwest Fox. Here is the official deal:

  1. All registered attendees of the SW Fox Conference that are not registered Visual FoxExpress users will receive a free copy of Visual FoxExpress including a 6 month subscription.
  2. All registered attendees of the SW Fox Conference that are registered Visual FoxExpress users will receive a 50% discount on a renewal of their Visual FoxExpress subscription.
  3. This offer is non-transferable and expires on 11/20/2007.

Wow. Mike and Toni have always been big supporters of the conference, and this is another fine example of F1 Technologies commitment to the Fox Community.

There is still some time and space available if you want to get registered. Only 66 days until we meet in Mesa!

Thanks Mike and Toni!

, ,

Aug
09

Catching up on the sponsors front… I want to announce two new sponsors recently signed up:

1) The Intellection Group, Inc. is a bronze sponsor. Dave Bernard is one of the leaders of this company and speaks at VFP conferences, and has been a friend of Southwest Fox at past conferences by writing up coverage on the UniversalThread. Dave’s company does some really cool stuff with Visual FoxPro on the Web, and is well know for his mantra: “There are no technical problems, only business problems.”

2) Servoy USA Inc is a gold sponsor. Servoy is making a serious push to FoxPro developers with their Java application development and deployment tools. I really do not know much about this company, but figure this is one of the reasons they are coming to Southwest Fox – to get their message out to the Fox Community.

More details about all the Southwest Fox Sponsors can be found here: http://swfox.net/sponsors.aspx

, ,

Aug
04

I am happy to announce I will be returning to Germany again this November to present at the 14th Microsoft Visual FoxPro Developer Conference 2007. This is a fantastic conference put on by Rainer Becker and his team. Rainer has an excellent collection of presenters presenting 60 VFP sessions:

English speaking: Marcia Akins, Craig Berntson, Steven Black, Jim Booth, Alan Griver, Doug Hennig, Venelina Jordanova, Andy Kramek, and Rick Schummer.

German speaking: Marcus Alt, Rainer Becker, Joachim Durr, Sebastian Flucke, Uwe Habermann, Jochim Hilgers, Kirsten Hinrichs, Armin Neudert, Michael Niethammer, Patrick Scharer, Markus Winhard, Christof Wollenhaupt, and Jurgen “wOOdy” Wondzinski.

I will be presenting four sessions:

  • SQL Server Toolkit for the VFP Developer
  • Fishing with a ProjectHook
  • VFPX Tools and Components – Live
  • Creating Help – Made Easy!

The conference is held at a terrific conference center that serves the best food you could ask for. There are lots of opportunities to network and vendors to visit as well. If you want to learn more about this popular conference you can read some of my blog entries in November 2006 and 2005 (see the index on my blog). I really recommend this conference!

, ,

Aug
03

I am please to announce Mike Roof is the lucky winner of the White Light Computing $300 Scholarship for the Southwest Fox 2007 conference. Mike’s company is sending four people to the conference so they increased their odds of winning {g}. I talked to Mike yesterday and he is very psyched about not only attending Southwest Fox, but he is also attending the West Wind Technologies Double Impact training the two days before Southwest Fox. We laughed how much his head will hurt after listening to Rick Strahl for two days, followed by two and a half more days of intense conference sessions. A fantastic training opportunity for any developer. It sounds like a lot of developers are taking advantage of this year.

Sorry for the delay in the announcement, but I ran out of time before my vacation and forgot to hold the drawing. Mike’s name was drawn by the lead marketing advisor here at White Light Computing out of the 85 names registered by July 1, 2007.

Congratulations Mike! Only 76 days until we meet in Mesa!

, , ,

Aug
01

I really thought the month of July would be really slow at the Southwest Fox registration headquarters because the deadline for early-bird registrations ended, but they keep on coming and today we registered our 100th person to attend the conference. Doug will be updating the Who’s Coming list soon, which now stands at 116 people including the presenters. Note: not all the people are on the list because each person has to opt-in.

Most of my expectations have been exceeded, and we are well on our way to breaking all records for Southwest Fox attendance. Only 78 days until Southwest Fox!

I am looking forward to seeing you in Mesa!

Southwest Fox 2007, Mesa, AZ, October 18 - 21, 2007

, ,