Stonefield Database Tool Kit – What’s New

Fix your corrupt Visual FoxPro database quickly and improve the Visual FoxPro data dictionary. Finally a serious tool for serious FoxPro developers – Stonefield Database Toolkit!

Click here to download the demo version

New Features in SDT 6.2

SDT 6.2 is now available! It works in VFP 6.0, 7.0, 8.0, and 9.0; if you’re using VFP 5.0, you should use SDT 5.1. The upgrade to SDT 6.2 is free for all current SDT subscribers.

Here are the enhancements in this new version.

  • SDT 6.2 supports the new Varchar, Varbinary, and Blob data types and new Binary index type in VFP 9.
  • The new CreateXMLMergeFile and LoadXMLMergeFile methods of DBCXMgr, written by Toni Feltman of F1 Technologies, create an XML file from meta data and load meta data from an XML file, respectively. These methods can be used to merge changes made by different developers into a single set of meta data.
  • For better support of databases that are distributed to multiple countries, you can now set the NCODEPAGE column of COREMETA to 0 for table records. This tells SDT to use the current codepage when creating tables rather than a hard-coded one from the meta data.
  • SDT now supports the updated ViewEditor Professional from White Light Computing.
  • The Field Repository now supports calculated fields.
  • A Field Repository field selected in the Database Explorer is now automatically selected in the Extended Table Designer when you modify the Field Repository.
  • Javier Borrajo kindly provided SDTSPANISH.H, a Spanish translation of the strings in SDTENGLISH.H. To create a Spanish version of SDT, change SDT.H to reference SDTSPANISH.H rather than SDTENGLISH.H and rebuild SDT.PJX with the “recompile all files” option turned on.
  • The SDTMgr GetFreeTablePath method now properly handles DBCXGetProp returning .NULL., indicating that the free table path hasn’t been filled in.
  • The Reindex, Repair, and NeedReindex methods now give a warning if a free table doesn’t exist.
  • Several bugs were fixed, including one in the SDT DBC events code that caused it to reference the wrong database under some conditions and a bug that prevented removed fields in free tables from being removed from the meta data when the meta data is validated.

New Features in SDT 6.1

  • SDT 6.1 works in VFP 6.0, 7.0, and 8.0; if you’re using VFP 5.0, you should use SDT 5.1. Here’s what’s new in this version.
  • SDT supports auto-incrementing fields, a new feature added in VFP 8. SDT makes it much easier to convert an existing table to use auto-incrementing fields (whether by converting an existing field to be auto-incrementing or adding a new auto-incrementing field) than it is using VFP commands alone.
  • SDT supports ViewEditor Professional 3.0, the premier view editing tool for VFP from White Light Computing.
  • SDT forms support themes in Windows XP.
  • The SDTMgr CloseAllAliases method is now public and documented.
  • The SDTMgr Reindex method now accepts a fourth parameter: pass .T. if you want SDT to trigger a warning (not necessarily displayed to the user, but logged to DBCXMgr.aErrorInfo) if the user clicks on the Cancel button in the Reindex dialog.
  • Views are now closed immediately after they are validated. Leaving them all open during validation wasn’t an issue with local views but could cause several connection licenses to be taken up with remote views.
  • If a view needs to be redefined because the structure of the underlying tables has changed, you are now asked if you want to redefine the view when the meta data is validated rather than being told that the view can’t be validated.
  • VFP 8 changes how the SQL engine deals with the GROUP BY clause in SQL SELECT statements and views (see the VFP help file for details). To avoid getting “GROUP BY clause missing or invalid” errors with views in VFP 8, SDT uses SET ENGINEBEHAVIOR 70 when validating or redefining views. Note that you should still fix these views, but at least they won’t trigger an error in SDT.
  • If you have an orphaned DBC record in the meta data (for example, you deleted a DBC you no longer need), after being prompted to locate the DBC when you open the meta data, you have the option of removing the DBC record from the meta data so you aren’t prompted in the future.
  • If the meta data validation process stops with an error (for example, a table is corrupted or can’t be opened), it now continues the entire meta data validation if you choose to continue.
  • DBCXMgr.Error now properly handles LINENO(1) in your global ON ERROR statement.
  • SDTMgr.CreateTempDBC, called from the Update method, ran somewhat slowly under certain conditions. This was improved.
  • A problem that prevented you from defining extended properties for calculated fields in the Extended Table Designer was fixed.
  • The performance of the Update method was improved under certain conditions: it formerly took an extra pass at the table when a field’s data type or size was changed and that field had the DefaultValue, RuleExpression, or RuleText property filled in.
  • Renaming a field in a table now properly renames that field in a view in a different DBC, as long as the other DBC is in the same set of meta data.
  • An issue in the SDTMgr Update method which caused a problem with a newly added field that had a DefaultValue property and was indexed was fixed.
  • Problems displaying the proper help file in the SDT Properties dialog and when the Database Explorer is still open but no longer has focus were corrected.
  • The Reindex method no longer gives an error if no tables in the meta data have an index.
  • Issues with reloading the Database Explorer TreeView after a renaming table were resolved.
  • Several bugs introduced in version 6.0d were fixed: a debugging statement we neglected to remove that caused ‘error’ to appear on SDT forms was removed, a “node not found” error when loading the Database Explorer TreeView was fixed, and the Database Explorer now shows the correct data type for fields rather than always displaying “Character”.

New Features in SDT 6.0

SDT 6.0 works in VFP 6.0 and 7.0; if you’re using VFP 5.0, you should use SDT 5.1. Here are the enhancements in this new version.

  • Database Explorer
    • Child nodes in the TreeView control of the Database Explorer are now optionally only created when the parent node is expanded for the first time (the default for the new Auto Load Tree setting is Off). The result is that the Database Explorer appears much faster for medium and large databases or those on a network drive.
    • The Database Explorer is no longer database-oriented, showing only a single database. It now shows all databases in a set of meta data. This is much handier than having to bring up multiple instances of the Database Explorer when you have multiple databases in your meta data.
    • You can now assign a “system” name to a set of meta data. This appears in a Most Recently Used (MRU) list in the Database Explorer and is used as the default in the Documentation dialog.
    • A new function in the Database Explorer allows you to open a different set of meta data without bringing up another instance of the Database Explorer.
    • The Database Explorer can now be opened without specifying a database container (such as if your meta data consists of only free tables).
  • The “Default location for DBCXREG” property is now used as an option for where to create the meta data if the “When DBCXREG.DBF cannot be found” option is set to a new “create in specific directory” choice. The new behavior when looking for DBCXREG.DBF is to look in the same directory as the DBC first, then in a list of directories specified in a new “Look for DBCXREG.DBF in” option. That way, you can switch between different databases in different projects without making the project directory current first.
  • You can now create a free table in SDT (in previous versions, you had to create it outside SDT, then add it to the meta data).
  • When SDT extensions are created for an existing set of meta data (for example, from a Visual FoxExpress application), any databases and free tables already in meta data are validated (previously, you had to validate each database and free table separately to create SDT meta data).
  • The Database Properties page now displays statistics about the selected database.
  • New functions in the Database Explorer allow you to add, remove, or create a database.
  • The Batch Add function now supports databases and free tables.
  • When you copy or move a view to another database, you are now asked if you want the table references in the view to be adjusted to the current database or not. The former behavior was to automatically adjust table references, assuming the view would now reference tables in the current database. This was fine if that’s what you wanted, but was a problem if you wanted to move all the views in one database to another to create “tables-only” and “views-only” databases.
  • The window size and position are now persisted.
  • If the “Modify in View Designer” checkbox is checked, the Database Explorer uses the VFP View Designer to modify a view. If not and Steve Sawyer’s View Editor is available, it’s used instead.
  • Remote views now have a different icon in the TreeView than local views.
  • Extended properties of fields are now propagated to view fields when View Field Inheritance is turned on.
  • The Database Explorer now handles the case where a view is removed from the DBC in Steve Sawyer’s View Editor.

Documentation

Instead of hard-coded filenames in the current directory, the Documentation dialog now respects the setting of the Output to File textbox when you output to HTML. Also, all selected reports are sent to a single HTML file rather than separate files.

TXT, not DOC, is used as the extension for text files. Also, you can now display the file after creation.

You can now print fields in the Fields report in natural or alphabetical order.

The Documentation dialog now respects the selection in the Database Explorer. If a table, view, or “Field Repository” is selected, it’s the default for reports. If “Tables” is selected, the “Print All Tables” option is checked. If “Views” is selected, the “Print All Views” option is checked.

Scripted HTML templates are now used for output. This is much easier to customize than the classes used in previous versions. The SDT Properties dialog allows you to specify which template to use for each report with Edit buttons to edit them and Revert buttons to restore the default templates.

Extended Table Designer

Views in all databases in the meta data are redefined when a table’s structure is changed.

Tables in all databases in the meta data are updated when a field in the Field Repository is changed.

The current alias is automatically removed from any index expression. This prevents lots of problems in VFP (such as in the RI Builder) caused by opening the table with a different alias.

The dialog asking you to confirm the deletion of a field now shows the field name.

If a field or index was selected in the Database Explorer when the table is modified, that field or index is automatically selected in the Extended Table Designer.

The window position is now persisted.

When a field is copied, SDT creates a sequentially-numbered field name; for example, copying TITLE gives TITLE1, then TITLE2, etc. However, in previous versions, it didn’t take into account a name that already ended with digits, so copying OPTION1 gives OPTIONS11, then OPTIONS12, etc. In SDT 6.0, it now takes existing digits into account.

General

Better performance by using the native “FoxTools” functions (such as ADDBS(), FORCEEXT(), JUSTPATH(), etc.) instead of DBCXMgr or SDTUtility methods.

Modernized user interface: SDT dialogs use hot tracking in VFP 7 and allow you to select the font for dialogs (the default is now Tahoma 9 point).

CCONTROL.VCX was renamed to SDTCONTROL.VCX, CONTROLS.VCX was renamed to SDTCONTROLS.VCX, and MANAGERS.VCX was renamed to SDTMANAGERS.VCX to avoid conflict with frameworks (such as CodeMine) that may use these class names.

The SDT item in the Tools menu now call the appropriate functions in the application they were installed from (no longer hard-coded as SDT.APP). This allows you to have different compiled versions for VFP 6 and 7, for example, named something like SDT6.APP and SDT7.APP, without interfering with each other.

Documentation is now online (a CHM file) and Help buttons are available in most dialogs.

SDTMgr and DBCX

The Update and Repair methods now accept lPack and lUseMetaData parameters which they pass to Reindex.

The functionality of the Visual FoxExpress-specific version of SDTMgr (SDTVFEMgr) was implemented in BaseMgr and SDTMgr so SDTVFEMgr is a much simpler subclass of SDTMgr.

The name and library of the class SDTMgr instantiates for the progress form are now stored in properties instead of hard-coded, allowing you to specify a different class if you wish.

PhDBase indexes are now validated properly rather than you having to manually enter the index expression in CoreMeta.mTagExpr.
UDFs called from view index expressions are now supported.

VFP 7 Database Events

SDT supports the new Database Events feature of VFP 7. A button in the Properties page for a database adds database event code from a template (which you can specify) to the database and turns on events. This code provides the same features SDT provides when table structure changes are made inside the Database Explorer to changes you make from anywhere (the VFP Table Designer, ALTER TABLE, etc.). This includes auto-validating the meta data, auto-redefining views, and handling view field property inheritance.

Bug Fixes

When the Field Repository node was selected in the Database Explorer, the Properties and Extended Properties pages didn’t display the correct information.

If you closed SDT’s tables from the DataSession window, you had to end-task VFP because the Database Explorer couldn’t be closed.

The setting of NOTIFY is now restored when the Database Explorer is closed.

If the fields list in the Summary report is more than one page, group headings weren’t reprinted.

Printing a report to a text file a second time appended the information into the file rather than overwriting it.

If the same table was opened in a second instance of the Extended Table Designer, it was closed in the first instance, so that instance failed when changes were saved.

If a table had no indexes, the controls in the Index page were disabled until you added an index, unlike the fields page which had enabled controls even when there were no fields.

If a table had no indexes, the controls in the Index page were disabled until you added an index, unlike the fields page which had enabled controls even when there were no fields.

Extended property values weren’t properly displayed or saved for calculated fields. Also, you couldn’t drag and drop calculated fields to a table.

If two databases with the same name are open and DBCXMgr.SetDatabase is called with the current one, when SDTMgr.OpenAllTables is called, it opens the tables in the other one.

SDTMgr.OpenData gets confused if a database with the same name (but different directory) as the current one is specified because DBUSED() is applied to lcDatabase, not lcDBC. Also, it should close the database first to ensure the correct one is opened. One problem: if tcDBC doesn’t contain a complete path, DBUSED() returns .F. even if the database is open but it isn’t in the current directory. So this has to be handled.

 

© Stonefield Software Inc. 2014 All rights reserved