cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
AceBear
Level 4

ADODB.RECORD Set stopped working in Installshield 2019

I have a Installscript MSI project. I have a function (see below) in the Script to query database and return a value. This function worked fine in our last released installer which was developed in Installshield 2016. This year, we upgraded Installshield 2016 to Installshield 2019 and then this function stopped working at the following line:

// Use the recordset to see if the database exists

pADORecordSetObj.Open(sSQL);

What can be the cause of this issue? How to catch the exception and get more details on the exception?

//**********************************************************

function STRING GetDMLANValue(sServerName, sDBName, sDriver) OBJECT pADOConnObj, pADORecordSetObj; STRING sConnString, sSQL, sLine, sDatabase, sLANValue, sError;

begin

sConnString = CreateConnectionStringIntegrated(sServerName, sDriver, sDBName);

//the sConnString is: "Provider=sqloledb;server=(local)\MyDBInstance;database=MyDB;Trusted_connection=Yes;Integrated Security=SSPI";   //the connection string has not changed

//MessageBox (sConnString, INFORMATION);

// Create the SQL string to retrieve the database if it exists

sSQL = "SELECT Value FROM [dbo].[APOCDMSYSCONFIGVALUE] WHERE NAME='Language'";

try

// Create ADO Connection Object to connect to the SQL server

set pADOConnObj = CreateObject(ADODB.Connection);

// Open the ADO Connection

pADOConnObj.Open(sConnString);

// Create ADO Recordset object for the return

set pADORecordSetObj = CreateObject(ADODB.Recordset);

// Set some ADO Recordset properties

pADORecordSetObj.CursorType = 3;

pADORecordSetObj.ActiveConnection = pADOConnObj;

// Use the recordset to see if the database exists

pADORecordSetObj.Open(sSQL);

if (pADORecordSetObj.RecordCount = 1) then

sLANValue = pADORecordSetObj.Fields(0);

else

sLANValue = "";

endif;

catch // nothing

MessageBox ("Cannot retrieve database record: " , INFORMATION);

endcatch;

return sLANValue;

end;

Labels (1)
0 Kudos
(1) Reply
ch_eng2
Level 6

We use similar scripts in InstallScript Only projects.  When we ran into issues with ".Open" failing (early 2019), it was actually traced back to a security setting in the Windows Registry - something Microsoft changed.  On the computer where you have the problem, look for this key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client

If there is a DWORD called "Enabled" with the value 1, try changing that to 0 and running your script again.

More info:

https://docs.microsoft.com/en-us/windows-server/security/tls/tls-registry-settings#tls-10

Our workaround is to prompt the user about this key and have them confirm that we change it for the duration of the install and set it back to 1 after.

HTH

0 Kudos