pyodbc

How to install pyodbc to be used in ipython

时光毁灭记忆、已成空白 提交于 2019-12-08 08:17:31
问题 I'm confused. I have installed pyodbc on my computer and I was able to import it using other IDE but i'm new to ipython. I use Ananconda , and was able to install other library using something like pip install BeautifulSoup But when I do that with pyodbc using pip install pyodbc I got error : error: command 'gcc' failed with exist status 1 C:\Users\jeannie.chirayu>pip install pyodbc Downloading/unpacking pyodbc You are installing a potentially insecure and unverifiable file. Future versio ns

Convert a pyodbc.Row to a string

左心房为你撑大大i 提交于 2019-12-08 06:35:14
问题 I need to convert a pyodbc.Row to a string. The internet provides several suggestions, none of which seem to work for me. row = cursor.fetchone() #unicodedata.normalize('NFKD', row).encode('ascii','ignore') #TypeError: must be unicode, not pyodbc.Row #row.fieldname.encode('utf8') #AttributeError: 'pyodbc.Row' object has no attribute 'fieldname' tblName = str(row) tblName.replace("text:u","").replace("'","") tblName = tblName.encode('utf-8') print tblName The above either give an error (shown

pyodbc and ms access 2010 connection error

喜欢而已 提交于 2019-12-08 06:18:43
问题 How can I access my Microsoft Access 2010 database (accdb) with pyodbc? Before, I used an mdb Database, which worked fine with the connection string being: ODBC_CONN_STR = 'DRIVER={Microsoft Access Driver (*.mdb)};DBQ=%s;' % ACCESS_DATABASE_FILE Now I use: import pyodbc ACCESS_DATABASE_FILE = "PSA_TEST.accdb" ODBC_CONN_STR = 'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=%s;' % ACCESS_DATABASE_FILE conn = pyodbc.connect(ODBC_CONN_STR) The error I get is: pyodbc.Error: ('HY000', '

Pyodbc Issue with Teradata

泄露秘密 提交于 2019-12-08 03:40:28
问题 Getting below error while connecting with Teradata from pyodbc in Linux ('632', '[632] 523 630 (0) (SQLDriverConnect)') Details below: Connection String DRIVER={Teradata};DBCNAME=;UID=;PWD=;QUIETMODE=YES; Pyodbc Version:pyodbc-2.1.8 Python Version: 2.7.3 Teradata below: RELEASE 14.10.03.07 VERSION 14.10.03.06 Linux Host Details: 2.6.39-400.17.2.el5uek Please help. 回答1: Need to export ODBCINI path, its done export ODBCINI=/opt/teradata/client/14.10/odbc_64/odbc.ini 来源: https://stackoverflow

Error connecting to MS SQL Server using pyODBC, unixODBC and FreeTDS (on a Mac)

不羁岁月 提交于 2019-12-08 02:04:29
问题 I am getting an error when trying to connect to a MS SQL server in python, using the pyODBC --> unixODBC --> FreeTDS --> MS SQL stack. I’ve spent a lot of time on this, and there are some great resources if you’ve reached this question with more fundamental problems getting a connection to work here and here. However, my question is regarding an error that (I think) is very close to the finish line of this very frustrating experience. Specifically, this code in jupyter notebook: pyodbc

pyodbc connection to mdb file

戏子无情 提交于 2019-12-08 01:36:36
问题 I am trying to connect pyodbc to an mdb file. I have searched this site and tried a number of things without success. Here is an overview of my system. Windows 7 Ultimate Service Pack 1 64 Operating System Python 3.4.0 installed in C:\Python34\ installed using python-3.4.0.amd64.msi pyodbc 3.0.7 installed using pyodbc-3.0.7.win-amd64-py3.4.exe Installed AccessDatabaseEngine.exe 14.0.6119.5000 MS 2007 Office System Driver Control Panel\All Control Panel Items\Administrative Tools Data Sources

How to configure the Database setting Django-MSSQL using django-pyodbc (ubuntu 16.04)?

爷,独闯天下 提交于 2019-12-07 20:56:59
问题 I'm new to Django and currently trying to use another database to save my model (i.e. MS SQL ). My database is deployed in a docker container: 903876e64b67 microsoft/mssql-server-linux "/bin/sh -c /opt/mssq" 5 hours ago Up 5 hours 0.0.0.0:8888->1433/tcp nauseous_williams I also create a new user for my login to the SQL Server. Username='kucing', password='xxxxx' With my user, I can use sqlcmd to access my DB as below: sqlcmd -S localhost,8888 -U kucing -P 'xxxxx' Therefore, I change my Django

Correct mt.exe syntax to resolve pyodbc import problems

纵饮孤独 提交于 2019-12-07 16:27:02
问题 I'm deploying a Python app on Windows for the first time (Apache & mod_wsgi/Flask/Sqlalchemy). I'd like to use pyodbc to get Sqlalchemy talking to mssql. I was able to install a binary build of pyodbc with no problem, and it works when I use it from the command line. However, mod_wsgi is logging import errors when it hits import pyodbc This thread on the pyodbc issue tracker describes my issue exactly, and seems to implicate Windows manifests. However, I can't figure out how to use mt.exe to

Python in Windows: large number of inserts using pyodbc causes memory leak

末鹿安然 提交于 2019-12-07 13:23:02
问题 I am trying to populate a MS SQL 2005 database using python on windows. I am inserting millions of rows, and by 7 million I am using almost a gigabyte of memory. The test below eats up 4 megs of RAM for each 100k rows inserted: import pyodbc connection=pyodbc.connect('DRIVER={SQL Server};SERVER=x;DATABASE=x;UID=x;PWD=x') cursor=connection.cursor() connection.autocommit=True while 1: cursor.execute("insert into x (a,b,c,d, e,f) VALUES (?,?,?,?,?,?)",1,2,3,4,5,6) mdbconn.close() Hack solution:

Using an ODBC application with a JDBC driver

戏子无情 提交于 2019-12-07 12:58:04
问题 My company uses Vertica. We have Python applications that connect to it with pyodbc. I do most of my development on a Mac (Snow Leopard) and unfortunately Vertica has not released ODBC drivers for Mac. They do have JDBC drivers though. I don't think developing in Jython is a good compromise. Is there any way to use JDBC drivers with an ODBC application? Some kind of ODBC connector? 回答1: edit: update for vertica 5/6 can be found here https://github.com/serbaut/psycopg2 Here is a patch to make