Our security does not allow us to enable SQL Server authentication on our SQL Server servers and trying to install MSSQL DDL generated by Gen causes an error:
TIS95DDL: Error -2147203052 connecting to the database server
TIS95DDL: Microsoft SQL-DMO (ODBC SQLState: 28000) returned error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '<server_name>\<instance_name>'. The user is not associated with a trusted SQL Server connection.
Therefore we would like to be able to install the DDL using a Windows Authentication trusted connection.
Installing using a trusted connection can be achieved as follows:
The module TIS95DDL.EXE is used by the Build Tool to install the MSSQL DDL. By default this uses SQL Server authentication with the values stored in the Build Tool profile DBMS/MSSQL tokens for OPT.DBUSER, OPT.DBPSWD, OPT.DBCONNECT. The source code for this module (tis95ddl.c) is supplied in the ddl sub-directory under the Gen install directory. To enable DDL installation via a trusted connection the following changes should be made:
- In function dbConnect go to the line:
hr = pSQL->lpVtbl->Connect(pSQL, wDatabase, wUsr, wPwd);Before the above line add this new line:
hr = pSQL->lpVtbl->SetLoginSecure(pSQL, TRUE);This ensures Windows Authentication/Trusted connection is used and the userid & password in the subsequent Connect are ignored.
- For message purposes the following can also be changed. Go to the first occurrence of the line
dbOutput(msg);i.e. this is the line after:
sprintf(msg, tidbms_GetMessage(CONNECTION_PARMS),change the parameter in the dbOutput call to be for example:
argv, argv, strlen(argv),
dbOutput("Using Windows Authentication/Trusted connection");
- Backup the current TIS95DDL.EXE in the Gen install directory.
SQL Server Platform SDK needs to be installed and the INCLUDE and LIB environment variables need to contain references to the relevant SQL Server Platform SDK directories
Run command 'makeddl mssql' to rebuild module TIS95DDL.EXE which will get updated in the Gen install directory.
- The new version of TIS95DDL.EXE will enable MSSQL DDL installs using a trusted connection.