问题描述
我想在 VBA 中检索当前连接到我的 Access 2010 项目的 sql Server 数据库的连接字符串。连接属性已插入信息/服务器/数据链接属性(图像链接)。有没有办法在 VBA 中检索这些信息?
已存储连接属性的位置:
解决方法
您的问题将在这里得到解答:Connecting to another access database in windows 365
见
Debug.Print CurrentProject.Connection.ConnectionString '普通连接
或
Debug.Print CurrentProject.AccessConnection.ConnectionString '用于可更新的表单