Configuring the Language and Database Connection for V2
Overview
When any V2 application is run, before a user logs in, then the CCLAS EL initialisation file is used to establish:
- The language in which screen prompts and error messages are displayed on the user interface.
- The database connection from the workstation to the CCLAS EL server.
When CCLAS EL V2 is first installed, the CCLAS EL initialisation file must be updated to configure these details.
After a user logs in, the user's Language CCLAS program setting is used to establish the language in which screen prompts and error messages are displayed on the user interface.
Process
Location of the CCLAS.INI File
When locating the initialisation file, the system first looks for a file named CCLAS_myComputerName.INI, and if that file is not found, then the system looks for a file named CCLAS.INI. If neither file is located, then an error returns.
The CCLAS_myComputerName.INI file allows for one initialisation file per user on a terminal server. This overcomes the problem where Windows 2000 AS Terminal Server does not resolve the GetWindowsDirectory API call, as per the documentation to the TS Client Windows folder, but simply returns the master Windows folder.
When locating the CCLAS.INI file, the system looks in the Windows, WinNT and CCLAS EL Exe folders, in that order.
Where the client workstation environment is locked down, this file is typically located in the Exe folder as read/write files cannot be put in the Windows or WinNT folders.
Structure of the CCLAS.INI File
A section within the initialisation file is denoted by [SectionName] and the next [NextSectionName] portion or end of file. A section can be named:
- [CCLAS]—The default CCLAS EL data set.
- [PREFERRED CONNECTION]—Preferred connections tying workstation names to an alternate CCLAS EL data set.
- [Alternate data set]—An alternate CCLAS EL data set.
The [CCLAS] Section
The [CCLAS] section contains the details used to establish a default CCLAS EL session upon user log in.
Language
Before a user logs in, the number of the language is set from the CCLAS.INI file for V2 and from appsettings.json file for V3.
After a user logs in, the user's Language CCLAS program setting defines the number of the language to be used in the interface for the staff member.
Refer to Using the Screen Interface to understand where the language strings are taken from once the number of the language is obtained.
Database Connection
Note: A CCLAS EL licence check is applied using case-sensitive server and database names.
The ConnectionName, DSN, PROVIDER, UID and PWD settings denote the name of the server containing the data set, the name of the data structure where the CCLAS EL database is located, the type of database, and the username and encrypted password used to access the data set, for example:
ConnectionName=2.40.0.2
DSN=Computer1;CCDEMO
UID=CCLASMGR
PROVIDER=SQLOLEDB
PWD=frymtoz~_
Where an ODBC connection is not to be used, set the ForceODBC setting to disabled, for example:
ForceODBC=Disabled
The ConnectionPoolMinimumSize setting denotes the maximum number of allowed connections to the database. A setting of 0 indicates no maximum:
ConnectionPoolMinimumSize=0
The ConnectionPoolTimerRefresh setting denotes the minimum amount of time after which a connection to the data set is refreshed after not being used. A setting of 0 indicates no minimum, for example:
ConnectionPoolTimerRefresh=0
The ConnectionPreamble setting denotes a SQL statement that is executed when the connection is initialised. This can be used, for example, to stop writers blocking readers for SQL SERVER. For example:
ConnectionPreamble = SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
Where the Crystal Reports report engine needs to generate reports from a particular CCLAS EL data set, the CrystalReportsDSN, CrystalReportsUID and CrystalReportsPWD settings denote the name of the server containing the reportable data set, and the username and encrypted password used to access the reportable data set, for example:
CrystalReportsDSN=NetworkComputer;DataSet 'If not defined, DSN is used.
CrystalReportsUID=CCLASREPORT 'If CrystalReportsUID is not defined, UID and PWD is used.
CrystalReportsPWD=ReportEncryptedPassword
Errors arising when Trying to Connect to the CCLAS EL Database Server
An [Alternate Data Set] Section
Where the initialisation file contains a section that is named something other than [CCLAS] or [PREFERRED CONNECTION] then it generally contains an alternate data set definition.
Alternate data set sections are used as follows:
- By reference from a preferred connection—See below.
- By the Pool Control application to overwrite the [CCLAS] section with the content of the alternate data set section.
- By a user when editing the CCLAS.INI file, to overwrite the [CCLAS] section with the content of the alternate data set section.
The [PREFERRED CONNECTION] Section
Where the initialisation file contains a [PREFERRED CONNECTION] section, then the rows within the section comprise a workstation name and section name, such that, where a CCLAS EL log in is detected from a named workstation, then the corresponding section name, which must exist as a section within the same initialisation file, is used to establish the session's language and database connection, thereby overriding the default session established with the [CCLAS] section.
[PREFERRED CONNECTION]
' Syntax is:
' WorkstationName=SectionName
PREPROOMIBM=CCLAS1
OFFICE_LAPTOP=CCLAS2
W123456=CCLAS1
Where a [PREFERRED CONNECTION] section does not exist within the initialisation file, then the [CCLAS] section is used to establish the session's language and database connection.
Example of a CCLAS.INI file:
CCLAS.INI
' Generic CCLAS section 1
[CCLAS1]
ErrorDLL=C:\CCLAS\EXE\CCERRES.DLL
MessageDLL=C:\CCLAS\EXE\CCMESSES.DLL
ExtendedErrorMessage=Enabled
Language=1
ForceODBC=Disabled
Debug=Disabled
ConnectionName=2.40.0.2
ConnectionPoolMinimumSize=0
ConnectionPoolTimerRefresh=0
DSN=Computer1;CCDEMO
UID=CCLASMGR
PROVIDER=SQLOLEDB
PWD=frymtoz~_
' Generic CCLAS section 2
[CCLAS2]
...
' Generic CCLAS section 3
[CCLAS3]
...
' Default CCLAS section
[CCLAS]
ErrorDLL=C:\CCLAS\EXE\CCERRES.DLL
MessageDLL=C:\CCLAS\EXE\CCMESSES.DLL
ExtendedErrorMessage=Enabled
Language=0
ForceODBC=Disabled
Debug=Disabled
ConnectionName=2.40.0.2
ConnectionPoolMinimumSize=0
ConnectionPoolTimerRefresh=0
DSN=Computer1;CCDEMO
UID=CCLASMGR
PROVIDER=SQLOLEDB
PWD=frymtoz~_ (encrypted password)
CrystalReportsDSN=NetworkComputer;DataSet 'If not defined, DSN is used.
CrystalReportsUID=CCLASREPORT 'If CrystalReportsUID is not defined, UID and PWD is used.
CrystalReportsPWD=ReportEncryptedPassword
ConnectionPreamble = SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED 'Used to specify the SQL statement to be executed when the connection is initialised. This can be used, for example, to stop writers blocking readers for SQL SERVER.
'
' Workstation Preferences
[PREFERRED CONNECTION]
' Syntax is:
' WorkstationName=SectionName
PREPROOMIBM=CCLAS1
OFFICE_LAPTOP=CCLAS2
W123456=CCLAS1