Potential problem when deploying Visual LANSA application with Other files to different DSN
|Date:||10 March 2004|
|Abstract:||Deployed Other files will include the DSN name which can cause application errors on target PCs|
|Submitted By:||LANSA Technical Support|
|Last Review:||December 2010|
When deploying a LANSA application with Other Files you may experience errors like these on the target machine:
MESSAGE : **** ODBC Error **** [Microsoft][ODBC Driver Manager];
Data source name not found and no default driver specified DBM
"Unable to free ODBC environment handle" error in the Application log and or X_ERR.LOG.
One potential reason that this can be generated is incorrect DSN name for an Other File. When loading 'Other' files into the Visual LANSA development environment, the ODBC database that was used to load the Other File is hardcoded into the I/O module. Whenever this file (OAM) is accessed, it will attempt to access the original DSN. If this DSN is not defined on the Target machine or if the DSN on the target machine is different to the DSN used in the development environment, the error above will be displayed.
The following extract is from the DEFINE_DB_SERVER section of the LANSA Technical Reference guide in the LANSA Online guides:
The Database Identifier must be a valid ODBC database name, defined in the 32-bit ODBC Administrator.
It would normally be the same as the ODBC database name that was used to load the Other File into LANSA.
By default, the same connection parameters will be used as when the Other File was loaded.
- The recommended approach for deploying Other Files is to ensure the DSN used for loading the Other File is the same as the DSN for the deployed application on the target machine.
- Create a DSN on the target with the same DSN name as on the development environment (that loaded the Other file). This will avoid the errors. However, you should test to ensure that the application works as expected if this workaround is used.
- Use the DEFINE_DB_SERVER BIF in your application to point at the DSN name for the Other files. Note, this DSN name must be a valid ODBC database name.