Wednesday, September 20, 2006

I am moving ...

After blogging here for almost two years, I have decided to move my weblog to weblogs.foxite.com.

The reason I do so is because I faced difficulty to create post here. It always take very long time to load, sometime even failed to load.

Anyhow, thank you blogger.com for providing free weblogs services.

My new weblog is at http://weblogs.foxite.com/kkchan/

See you there.

I am moving ...

After blogging at blogger.com for two years, I decided to move to new weblog service provider - weblogs.foxite.com.

The main reason for this decision is, it is very slow while I try to create new post here. Sometime, I even unable to create one.

Anyhow, thank you blogger.com for providing free weblog service.

My new weblog is at

I am moving ...

After blogging at blogger.com for two years, I decided to move to new weblog service provider - weblogs.foxite.com.

The main reason for this decision is, it is very slow while I try to create new post here. Sometime, I even unable to create one.

Anyhow, thank you blogger.com for providing free weblog service.

My new weblog is at

Saturday, September 16, 2006

Extending Data Explorer

As mentioned in my previous blog, I have choosen VFP9 Data Explorer as data querying tool during testing.

There are some features found in query analyzer but not in VFP data explorer.

1. Execute highlighted script instead of all of them.
2. Multi pages script editor.

The more I use data explorer, the more I miss these features. Therefore, I decided to write a prototype as "addin" to enhance data explorer.

Download the addin from here.

To add this "addin" to data explorer is easy.

1. Extract data explorer project from xsource.
2. Modify runqery.scx.
3. Drag and drop dataexplorerplugin class from czui.vcx to runquery form.
4. Recompile dataexplorer project to .app.



Next, it is time to try it out.

1. As usual, run the newly compiled dataexplorer.app from VFP IDE.
2. Drill down to desired connection. List of databases will be shown.
3. Select database, right click and select "Run Query" shortcut menu.
(As figure1 shown)


Figure 1 Run Query shortcut menu

4. Query form will be shown as Figure 2.


Figure 2 Query Form

5. As you can see the red rectangle area. It has multi pages. You can add/remove more pages by clicking the new page button and close page button at right top corner. (I just temporary use any icon at this moment)

6. To remove particular page, select desired page and click close page button.

7. To execute only part of script, highlight the script and press F5. You may notice that data explorer only have ONE result returned.
(As shown as Figure3)


Figure 3 Execute highlighted script

This also applicable to existing query addin. For example, if you highlight a line of script and run "clipboard as variable" addin, only highlighted script will be copied to clipboard as variable.

As mentioned it is just a prototype. There are a lot of enhancements required.

1. Refactor the code to be move extendable.
2. Each query page has its own result panel.

The other thing have to be considered is how to add new feature as above using addin approach;without need to recompile data explorer.

Any comments are welcomed.

Sunday, September 10, 2006

TechEd2006 SEA

I just back from TechEd2006 SEA. Overally, I feel abit dissapointed on this year session. I attended Developer, Architecture or Enterprise Data Management tracks.

I felt big dissapointed to developer track for this year because I didn't see any cool new features session. WPF is the one attract my interest mostly. However, it seem like more for UI designer rather than database developer like me. Topics on .NET 2.0 also are not new for me either (even though I didn't use it).

I am big fan of Architeture track. However, all of the sessions are level 100-200. It just provides overview and couldn't help much in my job. I think presenter should provide more scenarios, when to use each approach, how to apply it and what is the best practise.

The big new I get from here is IASA community is formed. It is community specially for anyone who interested on Software Architecture. It is run by IT industry expert, volunteery.

This is my first time to attend EDM track session. Generally, I feel satisfy with it. I learnt a lot about new SQL Server 2005 features. For example, table partitioning, database snapshot, database encryption and database mirroring. I think Microsoft very focus on high availability feature in SQL Server 2005. It is covered in at least three sessions. Each of them provide deeper information. I am going to research more and observe how it could be applied in my job.

Finally, I do feel the venue, facilities, crew services are good. But the foods .... hmmm... In fact, I never satisfy with TechEd food ever....

Anyway, I will attend TechEd2007 (if any, and held in KL, Malaysia) either because it the the most affordable conference. See you again in TechEd2007.

Why must you (VFP) setfocus to it?

I have a Visual Promatrix framework based application. It has few simple forms that consist of label_, textbox_ and textbox_output control(It is a textbox control that set readonly and return false in when event)

If user click new button followed by restore in some of my forms that contains more than ONE textbox_output controls, VFP will fall into "infinite loop".

There are many actions run while new and restore button clicked. Generally, it has common actions such as enable/disable controls during new/restore state.

During debugging, I found that when restore button clicked, all texboxes are disabled. Current active control.lostfocus will be fired. VFP will then try to setfocus to other controls. If the target control is textbox_output (e.g. txtEmployee_Name), VFP will not able to do that since textbox_output.When() always return False. Therefore, VFP would setfocus to next textbox_output control (if any). Of course VFP will fail to do that so. This action keeps happen to the rest of textbox_output controls and back to the txtEmployee_Name again and so on. VFP then falled into hang state.

I debugged other forms that also contains more than one textbox_output controls also but never face this strange behavour. I found that they are fine because the control VFP tried to setfocus is not textbox_output.

My current workaround is set all textbox_output.enabled = .F. However I feel curious on how VFP decide which control to setfocus? It doesn't follow tabindex nor record sequence in .scx.

Anyone can give me some ideas?

Friday, August 11, 2006

Procedure is not cleared!

I have three classes written in a single .prg file. An Asbtract class and two concrete classes.
AbstractClass
|
->ClassA
|
->ClassB
I creates an instance of each concrete class in my test program. At the end of program, I clean up them by
loClassA = .NULL.
loClassB = .NULL.

RELEASE loClassA, loClassB
RELEASE PROCEDURE myPrg

Then, I open up my .prg and try to change some code. VFP prompted me "Remove classes from memory?" Why would VFP still prompt message even though I have cleaned up? It happens for NEWOBJECT() and CREATEOBJECT(). I got to use CLEAR ALL to release it.

I did another tests again.
  1. Test 1 - Only initiate classA
  2. Test 2 - Initiate AbstractClass (ya, I know I shouldn't. It is just a test) and ClassA

Huh, VFP doesn't prompt "Remove classes from memory?"!!
I guess that VFP doesn't release abstractclass from memory if we initiate more than one concrete class which derived from same superclass. Anyway to solve it?

Update: Myron Kirby posted similar question at west-wind.com forum. Thank you Steven Black to provide the solution! :) It solved my problem too.

Wednesday, July 12, 2006

Small try on VFP DataExplorer

DataExplorer (DE) is an addon tool come with VFP9. It allows us to access VFP/SQL database from single interface. It acts as same functionality as Server Explorer in VisualStudio.NET.

I just have a small try on DE since last few days. The main reason I use it is, I want to check my data which stored in SQL Server 2005 for testing.

I use Query Anaylyzer QA) for data checking in SQL Server 2000, and I like it so much. However, Query Analyzer (isqlw.exe) is no longer available in SQL Server 2005. It has been built-in to SQL Server Management Studio (SSMS). Loading time of SSMS is very slow in my dual core processor, 1GB RAM machine. It becomes the reason for me to "abondon" SSMS and have a try with VFP DE.

DE is not as powerful as Query Anaylzer nor SSMS. But it is enough for me to check data. Some features and suprises (at least for me) I found during my exploring : -
  1. Can use T-SQL such as USE myDatabase inside DataExplorer.
  2. Supports F5 key to run "script".
  3. Supports multiple return result sets.
  4. Supports parameterized SQL statement. For example, VFP will prompt for input if we include "?mypara" in SQL.
  5. Query result is much faster than SSMS.
  6. Copy result to clipboard. Extremely fast!!
Although, most of the "suprises" mentioned above are part of VFP SPT functionality. That shouldn't be any suprise. However, when combine them to build a utility like DE, it gives me better perception of VFP. :)

One wishlist for DE, make result set updatable would be wonderful world!

Sunday, July 02, 2006

Project D.O.A

One more video posted, I was thinking it talks about how project manager would resolve their issues if they choose the wrong tool for their project.

However, ... It suprises me!!! :))

Direct link : http://video.google.com/videoplay?docid=-5677850239779225290

VFPX promo video

After VFP promo video, Kevin Ragsdale shared VFPX promo video.

Direct link : http://video.google.com/videoplay?docid=-8081999689198930750

Saturday, July 01, 2006

Another VFP Promo Video

Another VFP promo video posted by Kevin Ragsdale at Goodle Video.

Thank you, Kevin.