Wiki Home


Namespace: Wiki
Here's how to set up Stonefield Database Toolkit with Visual FoxExpress
In these instructions, the following directories are used:

\Stonefield - Stonefield products home directory
\VFE6 - F1's VFE home directory
\VFEProject - your VFE project directory

There are two parts: Installing and adding to a project. You only need to install once, but you have to add to each project.

Install and update all Stonefield products

In the \Stonefield directory, install each Stonefield product.

Check the Updates pages of Stonefield's Web site (, download the latest update of each applicable tool, and install the updates using the instructions included in the downloaded ZIP files.

From the Technical Papers page of Stonefield's Web site, download the "Integrating Stonefield Tools with VFE" ZIP file, which contains a Word document and class libraries.

Set up VFP

Use this step if you want to run your VFE application without building an APP or EXE so Stonefield's tools can find the components they need.

I don't think this works, because the VFE app resets the path to the dirs stored in the application object. I think you need to specifiy these in .cAdditionalPath of either iApplication or your apps application class. If you use the iLib one, be sure to "set as default" the one in the application class.

Choose the Options item in the Tools menu.

Select the File Locations page.

to the Search Path. If you also use Stonefield Reports, add:
If you use Stonefield Query but not Stonefield Reports, add:
Be sure to hit 'Set as default' before 'OK'.

Set up SDT

Select SDT Properties from the VFP Tools menu.

Set 'DBCXREG.DBF Default Location' to 'Specific Directory' and enter 'metadata\' as the directory. Don't use the ellipses button to select the directory as you want a relative path not a full path.

Set 'When DBCXREG.DBF cannot be found' to 'Ask for location'.

Press the OK button to complete the setting up of SDT.

Set up VFE6
Don't forget to do this after you update VFE. The service packs may overwrite these changes. They shouln't overwrite the iLibs, but check the VFE update docs to be sure.

Copy the following files into \VFE6\ILIBS (they come with Integrating document):,,

Update VFE's DBCX classes:
copy \stonefield\sdt\source\DBCXMGR.* \VFE6\VFEFRAME\LIBS
Add the following records to \VFE6\ILIBS\ICLASSES.DBF:
SDTDatabase Utilities FormiDatabaseMaintenanceFormSDTDatabaseMaintenanceForm
SFQQuery Criteria FormiQueryFormSFQQueryForm
SFR*Print Reports FormiRunQueryFormReportWizard

This implementation assumes that you want to use the various Stonefield tools with all of your VFE projects. If you only plan on using the Stonefield tools with some projects, or want to control on a project by project basis which Stonefield tools are used, see VFEExtending The Abstract Factory.

Prg to make the changes: __ VFEand SDTprg 1
Adjusting file references

Type the following in the Command window:
Open the Class Browser.

Open \VFE6\ILIBS\SDTVFE6.VCX in the Class Browser. Double-click on the SDTVFEMgr class; when the File Open dialog appears, find \Stonefield\SDT\SOURCE\SDT.VCX. Save and close this class.

Open \VFE6\ILIBS\SFRVFE6.VCX. Double-click on the SFRVFEDataEngine class; when the File Open dialog appears, find \Stonefield\SFREPORTS\SFREPORTS.VCX. Save and close this class. Repeat for the SFRVFEWizard class.

Add to project

Registering SDT as one of the DBCX managers if it isn't already

Open your project in the VFE Project Manager.

Click on the "Database Container Extensions" button, then click on the New button in the DBCX Managers dialog that appears.

Select SDTVFEMgr of VFE6\ILIBS\SDTVFE6.VCX (a special subclass of SDTMgr specific for VFE 6). Enter "Stonefield Database Toolkit" for the product name and "oSDTMgr" for the object name. Click on the OK button, then click on the Close button.

Click on the "Database Dictionary" button to bring up the DBCX Explorer, then click on your database and click on the Validate button. Repeat for each of the databases in your application.

Adding Stonefield objects to the project

_ Vfe And Sdt Prg does all this for you.

*SFRVFEWizard (in \VFE6\ILIBS\SFRVFE6.VCX) can't be used directly because it needs to know which database the application uses. Therefore, we create a subclass of this class, specific for the application called "ReportWizard" and place it in AREPORTS.VCX: Since it is a form, I put it in AFORMS so it appears under Miscellaneous Forms on the classes tab)

create class ReportWizard of \VfeProject\libs\aReports as SFRVFEWizard from \VFE6\ILIBS\SFRVFE6.VCX
Set \VfeProject\libs\aReports\SFRVFE6.VCX ReportWizard::cDBCName property {top level of class} to the database.

On the File page of the VFE Application Wizard, expand the Class Libraries item, then click on the Add button and add the following:

\Stonefield\SDT\SOURCE\SDT.VCX (for SDT)
\Stonefield\SFQUERY\SFQUERY.VCX (for Stonefield Reports or Stonefield Query)
\Stonefield\SFCOMMON\SFREGISTRY.VCX (for Stonefield Reports)
\VFE6\ILIBS\SFQVFE6.VCX (for Stonefield Reports or Stonefield Query)
\VFE6\ILIBS\SFRVFE6.VCX (for Stonefield Reports)
\VfeProject\libs\aReports.vcx (for Stonefield Reports)

Expand the Programs item, then click on the Add button and add the following:

\Stonefield\SFCOMMON\MAKEOBJECT.PRG (for any Stonefield product)
\Stonefield\SFREPORTS\SFREPORTS.PRG (for Stonefield Reports)

Expand the Other Files item, then click on the Add button and add the following:

\Stonefield\SFREPORTS\SFRFILE.BMP (for Stonefield Reports)

Expand the Free Tables item, then click on the Add button and add the following:

\Stonefield\SFREPORTS\SFREPIMG.DBF (for Stonefield Reports; make sure this file is marked as included)

Contributors Jeff Simon Carl Karsten Doug Hennig Mike Feltman Del Lee
Category Visual FoxExpress
( Topic last updated: 2000.05.09 11:48:31 AM )