【问题标题】:cannot find SQL server找不到 SQL 服务器
【发布时间】:2013-12-12 07:20:33
【问题描述】:

我正在尝试让 python/Django 应用程序在另一台机器上运行(从它开发的那台机器上),开发机器是 Windows 8 64 位机器,而新机器是 Windows 7 64 位机器机器。在两台机器上,我都有 DSN 可以毫无问题地连接到目标 SQL 服务器。在 win 8 机器上一切正常,在 Win 7 机器上使用 python 和其他代码在相同的相对位置我得到“0, u'ADODB.Connection', u'Provider cannot be found. 它可能不正确'" win 8 机器安装了 SQL 服务器实例,win 7 机器没有,它们都(理论上)指向第三个机器,即目标 SQL 服务器。这是我来自 django 应用程序的设置文件(数据库位)...

#CHANGE THESE  TO MATCH YOUR ENVIRONMENT#
#DBHOST = 'stevecwin764\sqlx2012'
DBHOST = 'tech6\gwrwin864'
#DBHOST = 'stevecwin764\sqlx2012'
#DBHOST = 'comtech04\sqlexpress'
SITEURL = ''

ADMINS = (
# ('Your Name', 'your_email@example.com'),
)

MANAGERS = ADMINS

DATABASES = {
   'default': {
    'ENGINE': 'sqlserver_ado', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
    #      'NAME': 'cv_demodb',                      # Or path to database file if using   sqlite3.
       'NAME': 'cv_masterdb',                      # Or path to database file if using   sqlite3.
    'USER': 'sa',                      # Not used with sqlite3.
    'PASSWORD': 'secret',                  # Not used with sqlite3.
    'HOST': DBHOST,                      # Set to empty string for localhost. Not used with sqlite3.
    'PORT': '',                      # Set to empty string for default. Not used with   sqlite3.
    'OPTIONS': {
      'provider': 'SQLNCLI10',
      'extra_params': 'DataTypeCompatibility=80;MARS Connection=True;',
    },
    }
    }

在 Win7 机器上运行相同的代码时,在 Win 8 机器上运行时,什么可能导致相同的代码失败?

【问题讨论】:

    标签: python sql django windows connection


    【解决方案1】:

    找不到你的提供者。它可能没有正确安装。'"

    这看起来不像是网络问题,看起来你没有在 win7 机器上安装正确的提供程序。这个答案有你需要的链接:https://stackoverflow.com/a/4026824/234254

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-06-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-26
      • 1970-01-01
      • 2017-08-02
      相关资源
      最近更新 更多