Forum Discussion

tuanvinh1008's avatar
tuanvinh1008
Contributor
3 years ago

TC hangout after connect to DB

Hi all,

Could you help me check my code? I don't know reason why I can't open the DB

 

 

function ReturnQueryRecordSetFromStrin1() {
    var QueryString = "";
    try
    {
      ConnectionObject = ADO.CreateADOConnection();
      ConnectionObject.ConnectionString = BuildConnectionString();
      ConnectionObject.Open();
      //var cmn = ADO.CreateADOCommand();
      //cmn.ConnectionString = ConnectionObject;
      var RecordSet = ConnectionObject.Execute_("SELECT * FROM ACOUNT");
      Log.Message(RecordSet)
      ConnectionObject.Close();

      return RecordSet;
    }
    catch (e)
    {
      Log.Error("Error running QueryString. See Additional Information for QueryString value: " + e.message, aqConvert.VarToStr(QueryString))
      ConnectionObject.Close();
      return aqObject.EmptyVariant;
    }
}

 

 

after run it. at the ConnectionObject.Open() method, it displays the error and hangs out the TC.

 

 

4 Replies

  • Hi tuanvinh1008 

     

    Hope you are well. 

     

    The code looks good

     

    I would open a ticket with our support team to check. 

     

    Provide all the details you mentioned here.

     

    In addition to this, please generate and provide an RG report from the machine in the support case. An RG report helps us know how the modules are behaving on the machine when the hanging occurs. To do this:
    1) Run the Report Generator tool located in <TestComplete>\x64\Bin\ReportGenerator.exe (for the 64-bit tool version) or <TestComplete>\Bin\ReportGenerator.exe (for the 32-bit tool version).

     

    KR

    Vinnie

      • gurman's avatar
        gurman
        New Contributor

        In your connection string, which DB driver/provider are you using to establish connection with your DB? Is it a 64-bit driver or 32-bit driver? If you are using 64-bit driver, you need to make sure that you are running 64-bit version of testcomplete(inside x64 folder in installation directory). If you are using a 32-bit driver, you should be running 32-bit version of testcomplete.