带有端口的VBA ADODB连接string

我正在使用ADODB连接到MySQL服务器的Excel VBA项目,但我无法弄清楚如何将端口信息添加到连接string。 我的连接代码工作,因为我已经连接到其他数据库的,但我最近搬到我的本地计算机,我有多个连接,每个都驻留在不同的端口。 这是我目前的连接string:

'''''''''''''''''''''''''''''''''''''''''''''''' ' My Laptop Connection '''''''''''''''''''''''''''''''''''''''''''''''' Public Const server_name As String = "127.0.0.1:5353" 'Enter your server name here - if running from a local computer use 127.0.0.1 or localhost Public Const database_name As String = "juice" 'Enter your database name here Public Const user_id As String = "root" 'Enter your user ID here Public Const password As String = "Password1" 'Enter your password here Public Const MySQLConnectStr As String = "DRIVER={MySQL ODBC 5.3 ANSI Driver}" _ & ";SERVER=" & server_name _ & ";DATABASE=" & database_name _ & ";UID=" & user_id _ & ";PWD=" & password _ & ";OPTION=16427" 

好吧,我在connectionstrings.com上计算了一下 – http://www.connectionstrings.com/mysql-connector-odbc-5-2/

您在单独的参数中提供端口。 看到我下面的固定代码。

 '''''''''''''''''''''''''''''''''''''''''''''''' ' My Laptop Connection '''''''''''''''''''''''''''''''''''''''''''''''' Public Const server_name As String = "127.0.0.1" 'Enter your server name here - if running from a local computer use 127.0.0.1 or localhost Public Const database_name As String = "juice" 'Enter your database name here Public Const user_id As String = "root" 'Enter your user ID here Public Const password As String = "Password1" 'Enter your password here Public Const port As String = "5353" 'If a specific port enter here. connection string uses 3306 by default. Public Const MySQLConnectStr As String = "DRIVER={MySQL ODBC 5.3 ANSI Driver}" _ & ";SERVER=" & server_name _ & ";PORT=" & port _ & ";DATABASE=" & database_name _ & ";UID=" & user_id _ & ";PWD=" & password _ & ";OPTION=16427"