This article will help application developers configure a Gen C application (GUI client or server) to access a database via Open Database Connectivity (ODBC).
Gen GUI C applications
Gen GUI applications are 32 bit so the DSN needs to be created using the 32 bit ODBC program "C:\Windows\SysWOW64\odbcad32.exe".
User DSNs will be available only to the user that creates the DSN. System DSNs are available to all users.
The name that is used for the DSN must match the database name in the Gen model Technical Design.
Some of the databases supported by Gen can be accessed by ODBC or embedded SQL.
The following are steps needed to set the database to use ODBC. This procedure assumes that the Technical Design has been set up and a database already installed.
Select the load module and click the Test push button.
When the first database access action diagram statement is executed, a Select Data Source window will appear and allow selection of the DSN for the database. Depending on the database, there may be another pop up box that will prompt for a database user ID and password that must be filled in to connect.
The user will be prompted to select the DSN each time the application is run. Alternatively modify the iefgdic.ini file to bypass the prompt.
The default location for the iefgdic.ini file is the directory "%USERPROFILE%\AppData\Local\CA\Gen 8.6\cfg\client".
The iefgdic.ini file may have multiple entries that already exist.If so, increase the DatabaseCount and then add a section at the bottom with name of the fields to the next number in sequence. For example, change DatabaseCount=2 and add a section with Database2, Trancode2, LoadModule2, Server2, SQLid2 and SQLPassword2.
Below is an example where there is just one database entry:
[MaxDatabases]
Max=100
[ODBC]
DatabaseCount=1x`
Database1=SAMPLE
Trancode1=
LoadModule1=
Server1=SAMPLE
SQLid1=userid
SQLPassword1=password