无法连接到数据库

2024-05-19 08:36:26 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在努力使用python 3连接到ODBC DSN。ODBC驱动程序是SCADA软件包供应商提供的只读驱动程序,不是标准MS或Oracle驱动程序类型

我试过:

import pyodbc
...
  connectionString = 'dsn=myDSN'
  connection = pyodbc.connect(connectionString)

这会产生错误:

('HY000', '[HY000] [Simba][ODBC] Not enough information provided to connection to data source and specified to not prompt for more information. (10042) (SQLDriverConnect); [HY000] [Simba][ODBC] Not enough information provided to connection to data source and specified to not prompt for more information. (10042)')

我试过:

import odbc
...
  conn = odbc.odbc('myDSN')

这会产生类似的错误:

[Simba][ODBC] Not enough information provided to connection to data source and specified to not prompt for more information. in LOGIN

我有一个反编译的第三方.net forms程序,我可以看到它使用了一个标准的System.Data.Odbc.OdbcConnection,使用了与上面pyodbc方法相同的简单连接字符串,它工作得很好

我已经阅读了pyodbc文档,但是我看不到任何其他需要设置的参数或属性,或者至少让它提示我没有提供的额外信息

以前有人遇到过这种情况吗

提前谢谢

迈克


Tags: andtosourcedatainformation驱动程序notconnection

热门问题