I'm trying to read a value from an Access database during an InstallScript only based InstallShield installer.
I've already retrieved the value, but with the code I have, the value (which is of type VARIANT) is only available while the ADO recordset is open. I'm writing a helper routine to retrieve these values, and would prefer to close the recordset before returning the value for use by a function caller.
szADORecordSetObjID = "ADODB.Recordset"; set pADORecordSetObj = CreateObject(szADORecordSetObjID); // Set some ADO Recordset properties pADORecordSetObj.CursorType = 3; pADORecordSetObj.ActiveConnection = pADOConnObj; // Use the recordset to run Query and retrieve single result pADORecordSetObj.Open(szSQL); varResult = pADORecordSetObj(0); // varResult is available here. From my understanding it is basically just a pointer. pADORecordSetObj.Close(); // and now the result is gone :< return varResult; // therefore this won't work
I'm working from a codebase that already does this, but it did not close the recordset before returning. This gets the value returned, but leaves an open recordset!
Any suggestions? I'm looking now for a way to copy the value from the VARIANT, but another method for getting the database value would be fine, too.
Thanks in advance for any help!