Forum Discussion

jdwather's avatar
jdwather
Contributor
7 years ago

TestComplete is still permance using the database file not allowing me to change name or delete

When performing a query without a database and then closing a connection, the TestComplete is still permance using the database file, use the database not allowing me to change its name or delete. Someone would know why it is permanent using the database.

2 Replies

  • ddang's avatar
    ddang
    SmartBear Alumni (Retired)

    Could you provide the script that you're trying to run? Also, I'm not really sure exactly what the issue is. What do you mean by, "the database is not allowing me to change its name or delete"?

     

    By "database file" I assume you mean a Table Stores object? Do you mean you're unable to delete or modify this object?

    • jdwather's avatar
      jdwather
      Contributor

      run a select in the database to fetch some information, then I close the connection, then I need to delete this database and copy a new database, but even I closing the connection to the database, I can not delete. I can only delete after stopping running the TestComplete. Sorry for English, it's not my language.
      Below the connection script and the script that deletes the database
      :

       

       

      function SelectBD(comandoString : string) : OleVariant;
      var Aconexao, RecSet, Cmd, Prm : OleVariant;
      begin
        Log.LockEvents();
        try
          AConexao := ADO.CreateConnection;
          AConexao.ConnectionString := 'Provider=MSDASQL.1;Persist Security Info=False; Data Source='+retornaStringBase;
          Aconexao.Open;
            Cmd := ADO.CreateCommand;
            Cmd.ActiveConnection := Aconexao;
            Cmd.CommandType := adCmdText;
            Cmd.CommandText := comandoString;
            RecSet := Cmd.Execute;
          
            result := RecSet;
          
          Aconexao.Close;
        except
          Log.Error('Exception', exceptionmessage);
        end;
        Log.LockEvents();
      end;


      procedurete deleteDataBase;
      begin
          aqFile.Delete(D:\Base_Eco\eco.eco');
      end;