This paper focuses on connecting tidal turbine farms to the French electrical grid. One tidal farm is considered, which is the commercial farm. The connection state is defined by the active power and the voltage at the common coupling point (PCC, also called the delivery point), and is constrained to respect the grid code requirements. In order to ensure this connection, this paper develops an active power control framework constrained to the requirements of the grid code. This framework is based on the solution of a quadratic programming problem to meet the power demand at the PCC while respecting the requirements of the grid code in different plans. As the farm will be installed at the ocean depths, several kilometers of cables will be used to transport the electricity up to the PCC. Then, the power losses are also taken into account in this framework. This framework is applied to a commercial farm with realistic data to show its relevance and effectiveness.