在ODBC数据源管理中访问DSN上的2010和服务器名称 [英] Access 2010 and Server Name on DSN in ODBC Data Source Administer

查看:109
本文介绍了在ODBC数据源管理中访问DSN上的2010和服务器名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一个主题:

[[我有一个用户DSN通过ODBC数据源管理器设置,它指向SQL服务器上的默认数据库。 Access中的所有表都链接到此数据库,并且我使用相同的Access应用程序,无论我是针对Dev还是Stage或Prod运行,只需更改用户DSN中的SERVER引用即可。我的问题是这个...有没有办法让Access知道我的ODBC连接指向哪个环境,并在报告上显示服务器名称?]]


第二个主题:

[[我有一个用户DSN通过ODBC数据源管理器设置,它指向SQL服务器上的默认数据库。 Access中的所有表都链接到此数据库,并且我使用相同的Access应用程序,无论我是针对Dev还是Stage或Prod运行,只需更改用户DSN中的SERVER引用即可。我的问题是...有没有办法让Access知道我的ODBC连接指向哪个环境,并在报告上显示服务器名称?]]

First Thread:
[[I have a User DSN set up through the ODBC Data Source Administrator, which points to a default database on SQL server. All my tables in Access are linked to this database, and I use the same Access application whether I''m running against Dev or Stage or Prod, by simply changing the SERVER reference in my User DSN. My question is this... is there a way for Access to know which environment my ODBC connection is pointing to, and display the server name on reports?]]

Second Thread:
[[I have a User DSN set up through the ODBC Data Source Administrator, which points to a default database on SQL server. All my tables in Access are linked to this database, and I use the same Access application whether I''m running against Dev or Stage or Prod, by simply changing the SERVER reference in my User DSN. My question is this... is there a way for Access to know which environment my ODBC connection is pointing to, and display the server name on reports?]]

推荐答案

当您链接表时,DSN只是作为参考点。 DSN的名称未存储在连接字符串中;存储服务器,数据库和其他连接属性。所以,是的,你可以从每个表的连接字符串中提取服务器名称。


你会使用类似
The DSN simply serves as a reference point when you link tables. The name of the DSN is not stored in the connection string; the server, database and other connection properties are stored. So, yes, you can pull the server name from each table''s connection string.

You''ll use something like
展开 | 选择 | Wrap | 行号


实际上存储了DSN名称,但不存储服务器名称。


从互联网上看,似乎没有简单的方法来阅读DSN信息。您可以做的是创建一个无DSN连接,只需将您在tempvar中选择的服务器名称存储起来,以便稍后提取并放入报告中。 DSN-Less Connection
Actually the DSN name is stored, but not the server name.

From looking around the Internet, there doesn''t seem to be an easy way to read the DSN information. What you could do is create a DSN-less connection and just store the server name that you have chosen in a tempvar to be able to pull later and put in the report. DSN-Less Connection


adefries:

请不要双重发布您的问题。

这违反了网站政策。


请记住,主持人,专家和其他人都是未付费的志愿者,他们试图在我们的工作义务和家庭责任之间提供一些帮助和指导。


请耐心等待?特别是在节假日和忙碌的发布日。


将来,两个线程都可能被删除。
adefries:
Please do not double post your question.

This is against the site policy.

Please keep in mind that moderators, experts, and others are un-paid volunteers that attempt to provide some help and guidance in-between our obligations to work and family.

Please be patient ? especially on holidays and busy posting days.

In the future, both threads may simply be deleted.


这篇关于在ODBC数据源管理中访问DSN上的2010和服务器名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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