通过 VBA 访问 Access 2010 中的数据 Link 属性

Access the Data Link Properties in Access 2010 through VBA

我想在 VBA 中检索当前连接到我的 Access 2010 项目的 SQL 服务器数据库的连接字符串。连接属性已插入 Info/Server/Data Link 属性(图片链接)。无论如何在 VBA 中检索此信息?

已存储连接属性的位置:

您的问题将在这里得到解答:

Debug.Print CurrentProject.Connection.ConnectionString 'Usual connection

Debug.Print CurrentProject.AccessConnection.ConnectionString 'Used for updateable forms