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?