连接到SQL Server的python中找不到提供程序错误 [英] provider cannot be found error in python connecting to SQL Server

查看:100
本文介绍了连接到SQL Server的python中找不到提供程序错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Python脚本连接到SQL Server数据库。我在连接字符串上使用SQLNCLI作为提供程序。

I'm attempting to connect to a SQL Server database within a Python script. I'm using SQLNCLI as provider on my connection string.

from win32com.client import Dispatch

connection_string = "Provider=SQLNCLI;server=%s;initial catalog=%s;user id=%s;password=%s"%(server,db_name,user,pwd)

dbConn = Dispatch("ADODB.Connection")

dbConn.Open( connection_string )

当执行脚本时,出现以下错误:

When executing the script I get this error:


提供程序找不到。

provider cannot be found. It may not be properly installed.

有关如何解决此问题的任何想法?

Any ideas on how to fix this?

推荐答案

...它是如此简单,只需安装:SQLNCLI.msi

...It is so simple just install this: SQLNCLI.msi

您可以在这里找到它: http://www.microsoft .com / downloads / zh-CN / details.aspx?FamilyID = d09c1d60-a13c-4479-9b91-9e8b9d835cdc& displaylang = zh-CN

you can find it here: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&displaylang=en

这篇关于连接到SQL Server的python中找不到提供程序错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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