Forum Discussion

ElizabethO's avatar
ElizabethO
Occasional Contributor
2 months ago

'ADO' is not defined error - TC v15.79

Each time I run a test that runs a python script I get the 'ADO is not defined' error, then I restart my TC and run the test again and then it works, meaning if I have 10 test cases that have python scripts within them , I have to restart TC each time before running each test. please has anyone experienced this ?

8 Replies

    • ElizabethO's avatar
      ElizabethO
      Occasional Contributor

      def Get_Available_Customer_Details_Not_Linked_To_Asset() :
        
        customer= executeQuery("SELECT TOP 1 [Number], [Name] FROM [dbo].[Asset] WHERE [Id] NOT IN (SELECT DISTINCT [AssetId] FROM [dbo].[Asset] WHERE [AssetId] IS NOT NULL)");
        
        for customer in customers :
            AssetNumber = customer["Number"]

            AssetName = safe["Name"]

            AssetDetails = f"{AssetNumber} {AssetName}"

            return assetDetails
        
        Log.Error("No available asset exists!");

      • rraghvani's avatar
        rraghvani
        Icon for Champion Level 3 rankChampion Level 3

        I don't see ADO usage, in the coding that you have provided? There should be something like,

        def TestProc():
          Cmd = ADO.CreateADOCommand()
          Cmd.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + \
          'Data Source=C:\\Users\\Public\\Documents\\TestComplete 14 Samples\\Desktop\\Checkpoints\\XML\\DataGridViewSample\\OrdersDB.mdb'
          Cmd.CommandText = 'SELECT * FROM orders WHERE orders.[state] = 2'
          # etc
        

         

  • scot1967's avatar
    scot1967
    Icon for Champion Level 3 rankChampion Level 3

    I have not seen this but if this worked in previous versions and only stopped when you upgraded versions and nothing else changed, check in with support.   Get them from the help menu or the open case using the link on the bottom left of this web page.

    https://support.smartbear.com/testcomplete/