为什么错误:“[ODBC Driver Manager] Data source name not found..."?(在开发环境中工作正常)

Why Error: quot;[ODBC Driver Manager] Data source name not found...quot;? (works fine on dev environment)(为什么错误:“[ODBC Driver Manager] Data source name not found...?(在开发环境中工作正常))
本文介绍了为什么错误:“[ODBC Driver Manager] Data source name not found..."?(在开发环境中工作正常)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 ASP 页面中遇到问题.这是一个登录页面,它在允许访问主页之前检查用户对数据库的凭据.我创建了一个调试器页面来找出错误详细信息,这是错误消息:

I'm encountering problems in my ASP page. This is a login page which checks the user's credentials to the database before it allows access to the main page. I created a debugger page to find out what's the error details and this is the error message:

 Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. 

这是我在登录网站时在网络服务器上遇到的错误消息.这里奇怪的是在我的机器(桌面)上本地测试页面时一切正常(即使使用 IIS 和 MSSQL 服务器).我在部署和测试页面时也使用了相同的连接字符串.

That's the error message I' m encountering on the web server when I'm loging in to the site. The weird thing here is when testing the page locally on my machine (desktop) everything works fine (even with IIS and MSSQL server). I'm also using the same connection string when deploying and testing the page.

请帮忙,任何建议或意见都将被极大地接受.

Please help, any suggestions or comments will be greatly accepted.

谢谢,诺伊蒂

推荐答案

问题可能出在 ODBC 配置 服务器本身.换句话说,[到 ODBC 源] 的连接字符串是可以的(因为在其他服务器上测试过),但它引用了未在此特定服务器上配置的源.

The problem is probably with the ODBC configuration on the Server itself. In other words the connection string [to the ODBC source] is ok (since tested on other server), but it makes reference to a source that is not configured on this particular server.

要解决此问题,请打开 ODBC 数据源管理器(通常是管理"工具菜单中的快捷方式之一),并检查您是否确实找到了同名的源(通常是系统 DSN")在连接字符串中.此类来源可能不存在或配置不正确.

To remedy the problem, open the ODBC Data Source Administrator (typically one of the shortcuts in the "Administrative" tools menu), and check if indeed you have a source (typically a "System DSN") with the same name found in the connection string. Such Source is probably inexistant or improperly configured.

除了性能考虑之外,可以考虑在连接字符串级别使用更直接的 Data Providers(例如 MS SQL Data Provider 或 Microsoft.Jet.OLEDB);这避免了服务器上的额外配置点(ODBC 配置面板)(但这可能需要使用两个不同的连接字符串,一个用于测试环境,一个用于生产环境......)

Aside from performance considerations, one may consider using more direct Data Providers (such as MS SQL Data Provider or Microsoft.Jet.OLEDB) at the level of the connection string; this avoids the extra configuration point (the ODBC config panel) on the server (but then this may require using two distinct connections strings, one for the test environment and one for the production environment...)

这篇关于为什么错误:“[ODBC Driver Manager] Data source name not found..."?(在开发环境中工作正常)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
SSIS: Model design issue causing duplications - can two fact tables be connected?(SSIS:模型设计问题导致重复-两个事实表可以连接吗?)
SQL Server Graph Database - shortest path using multiple edge types(SQL Server图形数据库-使用多种边类型的最短路径)
Invalid column name when using EF Core filtered includes(使用EF核心过滤包括时无效的列名)
How should make faster SQL Server filtering procedure with many parameters(如何让多参数的SQL Server过滤程序更快)
How can I generate an entity–relationship (ER) diagram of a database using Microsoft SQL Server Management Studio?(如何使用Microsoft SQL Server Management Studio生成数据库的实体关系(ER)图?)