如何将excel工作表的连接字符串转换为String变量 [英] How do I get the connection string of my excel worksheet into a String variable

查看:178
本文介绍了如何将excel工作表的连接字符串转换为String变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在开发一个插件来将工作表的连接字符串更改为新的连接字符串。所以,我需要将工作表的连接字符串放入我的函数中的String变量中。是否有工作表对象的属性将连接字符串转换为变量??



问候,

Megha

Hi,

I am developing an addin to change the connection string of a worksheet to new connection string. So, I need to get the connection string of the worksheet into a String variable in my function. Is there a property of worksheet object to get the connection string into a variable??

Regards,
Megha

推荐答案

不确定我是否正确理解您的问题,但如果您想调查和修改工作簿的现有连接,可以通过 Connections对象 [ ^ ]。每个项目都是 WorkbookConnection [ ^ ]其中包含有关实际连接的详细信息。请注意,如果连接是OLE DB或ODBC,则调查OLEDBConnection或ODBCConnection属性。
Not sure if I understand your question correctly, but if you want to investigate and modify existing connections of a workbook, you can enumerate through Connections object[^]. Each item is a WorkbookConnection[^] which contains details about the actual connection. Note that if the connection is OLE DB or ODBC then investigate the OLEDBConnection or ODBCConnection properties.


这篇关于如何将excel工作表的连接字符串转换为String变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆