Forum Discussion

hrothrock's avatar
hrothrock
Contributor
5 years ago
Solved

CheckSynchronize called from thread which is NOT the main thread

In my Javascript project, I am trying to connect to a SQL database. When it gets to the Open() function, it throws an error that says "CheckSynchronize called from thread which is NOT the main thread" -- I can't click OK to get out of it, the message just keeps coming back. I have to end task in task manager and come back in. Below is my code. Right before the CheckSynchronize error comes up, it brings up a login dialog and enters the user name that is in the connection string. It doesn't appear to get to the password.

 

var aCon, RecSet;
aCon = ADO.CreateADOConnection();
aCon.ConnectionString = "Data Source=remoteDesktopAddress, portNumber;Initial Catalog=NameOfDatabase;user id=SQLuserName;password=SQLPassword";
aCon.Open();

 

 

  • Hi hrothrock,

     

    Thanks for checking this. It sounds like this question requires a deeper investigation. Could you please zip your project and send it to the TestComplete Support Team? They will analyze the project and come back to you with the solution.

     

     

9 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    That's rather strange.  ADO connections shouldn't actually do any displayed login or anything.  What kinda of SQL server are you connecting to?

    • hrothrock's avatar
      hrothrock
      Contributor

      Microsoft SQL Server Developer (SQL 2016). 

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        OK, what other code are you executing?  Again, because ADO doesn't open any sort of UI, I'm assuming that the login screen you're seeing is coming from some other code.  Let's set aside the ADO stuff for now because I think we're dealing with a different problem.

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi hrothrock,

     

    Does TestComplete bring this error? Do you see the TC logo on the error dialog?

     

    Is it possible that you run the function that has some parameters? For example, your code is inside a function like this:

    function test(a, b)
    var aCon, RecSet;
    aCon = ADO.CreateADOConnection();
    aCon.ConnectionString = "Data Source=remoteDesktopAddress, portNumber;Initial Catalog=NameOfDatabase;user id=SQLuserName;password=SQLPassword";
    aCon.Open();
    }

    If you have the parameters in the function, you cannot run a routine via right-click.

     

    Could you please check this?

     

     

     

     

     

     

    • hrothrock's avatar
      hrothrock
      Contributor

      Tanya, I have no parameters in my function. I have tried this (accidentally) in the past and the option to run the function is disabled. I am not sure what program other than TestComplete would be returning the error but I guess it's possible?

       

      Thanks.

      • TanyaYatskovska's avatar
        TanyaYatskovska
        SmartBear Alumni (Retired)

        Hi hrothrock,

         

        Thanks for checking this. It sounds like this question requires a deeper investigation. Could you please zip your project and send it to the TestComplete Support Team? They will analyze the project and come back to you with the solution.