In general, the error "Invalid connection. (MDS 00004)" occurs if there is any misconfiguration of the parameters that are used to establish connection to the Virtual DataPort Server.
In order to overcome this issue, I would verify the following,
* The following files are named correctly as below,
* The connection parameters specified in the "vdp.sbo" and "vdpen.cod" files match the connection setting. For example, in the JDBC connection parameters for URL, I would ensure that the DATASOURCE and DATABASE variables remain as they are.
<Parameter Name="URL Format">jdbc:vdb://$DATASOURCE$/$DATABASE$</Parameter>
* To communicate with Virtual DataPort from Business Object replace the values of JDBC parameters from "jdbc" and "generic_jdbc" values to "vdp" in "vdp.sbo" and "vdpen.cod" files.
Hence, to establish a successful connection, make sure to follow all the steps given in the Knowledge Base article, [How to access VDP from SAP BusinessObjects](https://community.denodo.com/kb/view/document/How%20to%20access%20VDP%20from%20SAP%20BusinessObjects?category=Northbound+Connections).
Hope this helps!