Development with Visual Basic and other tools
- Last Updated: November 5, 2020
- 1 minute read
- DataDirect Connectors
- ODBC
- Documentation
Some development tools, including Visual Basic, do not provide a means for calling the ODBC driver manager directly. For these tools, you enable the ODBC drivers by calling SetLicenseInfo (VBSetLicenseInfo for Visual Basic). The SetLicenseInfo call is defined in the driver DLL, for example:
xxrsftnn.DLL
for the Amazon Redshift Wire Protocol driver, where xx refers to the two characters specified during branding of the drivers and nn refers to the release level of the drivers. See "Before branding the drivers" for more information about specifying driver file names.
To call SetLicenseInfo, follow these guidelines:
- Declare the function in the environment you are using. For example, the
following statement declares the VBSetLicenseInfo function in a Visual Basic project file:
Declare Function VBSetLicenseInfo Lib "xxrsftnn.DLL"(ByVal FileName$, ByVal Password$) As Integer - Make the application call SetLicenseInfo before connecting to a database.
For example, the following Visual Basic call sets up the 32-bit ODBC drivers to use the
license file IVxx.LIC with a password:
res% = VBSetLicenseInfo ("IVxx.LIC", "password")
The result code returned by VBSetLicenseInfo is successful only if the correct number of parameters and parameter names is passed to the function. If the license file or password is omitted or named incorrectly, the first connection to the database fails and the following error message is generated:
Invalid License File