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.

0 Comments:

Post a Comment

<< Home