如何在ms-access VBA中检索表的odbc数据库名称
我有一个 ms-access 数据库和几个 ODBC 链接表。
因为我有两套 ODBC 数据库,一套用于生产,另一套用于开发,它们有不同的名称“开发”和“生产”。
如何使用VBA获取链接表的odbc信息?
I have a ms-access database and several ODBC linked tables in it.
As I have 2 set of ODBC database ,one is for production the other is for development, they have different names Development and Production.
How can I get the odbc info of the linked tables by using VBA?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用表的本地名称,您可以在 MSysObjects 系统表(通常是隐藏的)中查询该表的外来名称。
如果您需要有关外部表的更多信息,请尝试解析同一个表中的“连接”列。
Using the local name of the table, you can query the MSysObjects system table (typically hidden) for the table's Foreign Name.
If you need more information about the foreign table, try your hand at parsing the 'Connect' column from the same table.
事实上,您可以使用 ODBC 连接到 .mdb 文件,就好像它是 Access 数据库一样。 链接表将显示在该 ODBC 连接中,并且可以以全 ODBC 速度进行访问。
这样做的好处是您的程序甚至不必知道表是否是链接表。 将所有这些系统管理员级别的详细信息包含在一个地方是很好的。
In fact, you can use ODBC to connect to the .mdb file as if it were an Access database. The linked tables will show up in that ODBC connection and be accessible at full ODBC speeds.
The nice thing about doing it that way is your program doesn't even have to know if the tables are linked tables or not. It's nice to contain all these sysadmin-level details in a single place.
我确定源的常用方法是重命名表,就像重命名本机表一样。 我可以添加后缀或前缀,例如
tblTrombone_DEV
和tblTrombone_PROD
。My usual method of determining the source is to rename the tables, just like you would a native table. I may add a suffix or prefix such as
tblTrombone_DEV
andtblTrombone_PROD
.