The invention relates to an adapter (3) attached to a human or animal body at a stoma, a detachable lid (4) on the adapter, and a connector (2;49) for connecting an ostomy bag (1) to the adapter. The adapter (3) is of the kind which comprises a protruding section (18) extending from the stoma, and mounting means (20) for mounting a detachable lid (4) onto the end of the protruding section. The adapter (3) and lid (4) are arranged such that the lid can be slid onto and off the adapter in a direction relatively perpendicular to the axis of the protruding section of the adapter. The connector (2;49) is arranged to connect the ostomy bag (1) to the adapter (3) and to slide the lid (4) off the adapter. In this way, there is no risk of odors or waste leaking from the adapter or the ostomy bag while the bag is being connected to the adapter.