rmBDEConfig.cc  
 

A Custom Control for configuring the BDE

 


I consider this a "must have" utility custom control. Every application I develop from this point on will make use of this control. Why has it taken so many years to realise the need for this ?

If you distribute compiled applications, and the user is expected to install and use your application without any support from you, then how can you ensure that the BDE is set up correctly with the settings you want ?

How can you ensure that at some point further down the line that somebody, or some other application installation has not interfered with the BDE settings you require ?

In some cases, a single BDE setting will be the difference between your application working, and not working at all.

This class is intended to do this job for you, at the point of first run, and on every occasion that your application is run thereafter. Using this control should reduce the likelihood of the requirement of user support.

The demo form above rmBDEConfigTest.wfm allows you to test some of the features of this control, and does so in a verbose way, but the control is normally configured to run silently unless there is a problem.

WARNING : This control will change your BDE settings. Please ensure that you have checked all of the default control properties relating to BDE settings and that you are happy with them. Please ensure that you understand what this control does before you run either of the supplied demo forms or use this class from your own code.

While the above demo form is good for demonstration purposes, it is not really an indication of the way that this class is intended to be used.

This second form rmBDEConfigSample.wfm is a better indication of how this control should be used. Make some settings changes with the first form, and then run this one. All BDE settings will now match the cc defaults. Run this form a second time and it opens with no fuss, the BDE checks having been made.

Most applications will have an "opening form". Simply use the rmBDEConfig class from this form in the form's onOpen event, or even do this from code before the first form even opens. The class is easily configurable for use as a non visible object class, or as a form object depending on your coding preferences.

A user may not have the required permissions to allow this control to update the registry. In that event, and if a BDE settings update is found to be required, they will receive the following advice :

Once this job has been done with the correct permissions, your application will silently check the BDE settings on every run, and this control will only raise its head again should some action be needed.

This control currently has built in language support for :

  • Danish
  • English
  • French
  • German
  • Italian
  • Spanish
  • Traditional Chinese

The language can be set by a simple edit of a Constant value in the header of the class. A quick change to Danish gives this version of the above dialogue :

The control will also create a disk log file of any changes that have been made, and any errors that have occurred. The location of this log file defaults to the application directory, but can be set to any location where the user has write permissions such that all your dBASE applications can share a single rmBDEConfigLog file.

This control requires rmRegistry.cc to be present.

See rmBDEConfigTest.wfm and rmBDEConfigSample.wfm for sample usage and code.