On Windows platforms, ODBC drivers normally retrieve configuration information from the Windows registry. As an alternative, your driver can retrieve its driver-specific configuration information from an .
ini file. This enables customers to deploy multiple versions of the DLL, each with a different version of the driver-specific configuration information. You can also specify that your driver to look for the .
ini file initially, then fall back to the registry if the file cannot be found.
You can use a configuration file, for example
simba.quickstart.ini, to specify the information that is normally retrieved from the SOFTWARE\Simba\Quickstart\Driver registry key.
inifiles for information that is stored in the \ODBC\ODBC.INI and \ODBC\ODBCINST registry keys. You still need to configure these registry keys for your custom driver.
Create a text file that contains all the information in the driver's HKEY_LOCAL_MACHINE\SOFTWARE\Simba\Quickstart\Driver registry key. The file has the same format as the
simba.quickstart.ini file on Linux and Unix platforms.
Example - simba.quickstart.ini file
Simba::DSI::DSIDriverFactory() method in the
Main_Windows.cpp file, replace the call to
SetModuleId(). These methods must be called before any parameter from the
SimbaSettingReader is accessed, because the configuration is loaded only once, and cannot be reloaded.
You also need to provide the module ID, using the value provided to the
DLLMain() function that is called when the driver is loaded.
Example - DSIDriverFactory
/// @brief Creates an instance of IDriver for a driver.
/// The resulting object is made available through DSIDriverSingleton::GetDSIDriver().
/// @param out_instanceID Unique identifier for the IDriver instance.
/// @return IDriver instance. (OWN)
IDriver* Simba::DSI::DSIDriverFactory(simba_handle& out_instanceID)
out_instanceID = s_quickstartModuleId;
//Set the name of the INI file from which to load the driver-specific configuration.
// If a file name is specified here, the SEN SDK will first try to load the driver specific
// configuration from that INI file. If it can't find the file, it will fall
// back to the registry, as described below.
// You can specify a relative path for the file name. If the module ID (see below) is
// 0, then the path is relative to the current working directory. If the module
// ID is non-zero, the path is relative to the
// directory where the DLL is located.
// Set the module identifier provided in DLLMain().
//This allows the SDK to determine in which
// directory the driver DLL is located, which is used to load INI file defined
// as relative path as described above.
// Use this setting to specify the registry key that is used if the
// driver cannot find the .ini file.
// For example, if you use the value "Simba\Quickstart", then
// the driver looks for the configuration information at
// HKLM\SOFTWARE\Simba\Quickstart, or
// HKLM\SOFTWARE\SOFTWARE\Wow6432Node\Simba\Quickstart if
// running a 32-bit driver on 64-bit Windows).
// If the DSII is compiled as a driver, then it will use \Driver as the final
// value in the registry path.
// If the DSII is compiled as a server, then it will use \Server as the final
// value in the registry path.
// For example, a 64-bit driver would use
// HKLM\SOFTWARE\Simba\Quickstart\Driver to look up the registry keys such as ErrorMessagesPath.
// Set the server branding for this data source. This will only be used if the DSII is compiled
// as a server and then installed as a service.
#if defined(SERVERTARGET) && defined(WIN32)
return new QSDriver();