Questions tagged [pypyodbc]

pypyodbc is a pure Python ODBC interface module. (Not to be confused with pyodbc, which performs many of the same functions but was written as an *extension module* in C++.)

pypyodbc is a pure Python interface module. It is very similar to , which performs many of the same functions but was written as an extension module in C++.

In addition to being a very good ODBC Library in its own right, pypyodbc is a useful alternative to pyodbc in situations where pyodbc encounters difficulties.

For more information, see

pypyodbc - A Pure Python ODBC Library

Installation is available from pip:

pip install pypyodbc

Or by downloading installation package. (Unzip, navigate to folder, and run:)

python setup.py install
285 questions
3
votes
1 answer

Connecting to MSSQL Server using pypyodbc on OS X

I'm having problems making a basic connection to a MSSQL Database Server using pypyodbc on OS X. I have installed both unixodbc and freetds via Homebrew brew install unixodbc brew install freetds I then installed pypyodbc mkvirtualenv test pip…
James Mills
  • 18,669
  • 3
  • 49
  • 62
3
votes
2 answers

using pypyodbc to access a table with spaces in its name

This command works fine.. count = conn.cursor().execute("select COUNT(*) FROM Orders;").fetchall() However this command kicks back an error count = conn.cursor().execute("select COUNT(*) FROM "Summary of Sales"; ").fetchall() The error…
user3443610
  • 31
  • 1
  • 2
2
votes
2 answers

How to create a tuple of row[colname] from df.iterrows() based off a dictionary

I'm trying to create a tuple that is based on a dictionary of df column names to pass through my cursor when dumping data into a database. Imagine a df with 3 columns: colA colB colC 1awf pref 02-03-2021 2fef cpvd 02-02-2021 3ace …
Chrestomanci
  • 201
  • 1
  • 9
2
votes
2 answers

Connecting Django to Microsoft SQL Database

I want to connect my django application to MS-SQL server 2014 database. I wrote this code for making connections. DATABASES = { 'default': { 'ENGINE': 'sql_server.pyodbc', 'HOST':'DESKTOP-6UNRAN0', 'PORT':'1433', 'NAME': 'MOVIE', …
2
votes
1 answer

How to create and delete database using mssql+pyodbc connection string using python

I have a database engine as the below: from sqlalchemy import create_engine import pydoc # connect db engine = create_engine('mssql+pyodbc://xxxx\MARTRNO_EXPRESS/toolDB?driver=SQL+Server+Native+Client+11.0') connection = engine.connect() I tried…
Mahmoud Al-Haroon
  • 2,239
  • 7
  • 36
  • 72
2
votes
1 answer

"Optional feature not implemented" error with pyodbc query against Access database

To anyone that can help, thank you in advance. I am running 64bit windows 10, 64bit office and 64bit python 3.7.2 Using pyodbc, I am trying to execute a Select statement such as this: "SELECT * FROM EconVars WHERE Year(ValueDate) = 1999" In order…
user78913
  • 73
  • 7
2
votes
1 answer

Modify existing MS Access Query via ODBC

I have a python script that update and generates exports in ArcMap. The ArcMap document pulls data to be mapped from MS Access. Currently, I have to go into to MS Access and update the criteria for a date from/to column (in design view) and save it…
Jack Wright
  • 35
  • 1
  • 5
2
votes
1 answer

Error Using SQL Server ODBC on Mac: [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)")

Getting this error after doing the install steps as listed out here: brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release brew update HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=y brew install --no-sandbox msodbcsql17…
Micah
  • 10,295
  • 13
  • 66
  • 95
2
votes
0 answers

What could be causing pypyodbc to display this error

I'm trying to switch my script over to pypyodbc from pyodbc. I have the following connect string: cnxn = pyodbc.connect('DSN=Teradata ODBC DSN;DATABASE=*******;UID=******;PWD=******') which works perfectly fine with pyodbc, but when I go to use…
lacrosse1991
  • 2,972
  • 7
  • 38
  • 47
2
votes
1 answer

How to create multiple volatile tables in Python from Teradata using pyodbc

I am trying to run Teradata sql code in Python. The code involves building volatile tables but I still get error message when trying to create the second volatile table. Error Message below: [Teradata][ODBC Teradata Driver][Teradata Database] Only…
May Y
  • 179
  • 1
  • 20
2
votes
0 answers

pypyodbc and pandas printing Chinese characters on a Mac

I am trying to query a MS SQL Server database from a Mac using pandas and pypyodbc. My columns names are returned in Chinese characters. This does not happen when running the code from a Windows-based machine. I tried setting the display encoding…
user2242044
  • 8,803
  • 25
  • 97
  • 164
2
votes
1 answer

Speed up insertion of pandas dataframe using fast_executemany Python pyodbc

I am trying to insert data contained in a .csv file from my pc to a remote server. The values are inserted in a table that contains 3 columns, namely Timestamp, Value and TimeseriesID. I have to insert approximately 3000 rows at a time, therefore I…
Nisfa
  • 359
  • 1
  • 4
  • 16
2
votes
1 answer

Python - special characters in SQL statement

I am connecting to MS Access using ODBC (Python ODBC module ). There is one part of the code which put some values into DB. Looks similar to this: for item in changes: format_str = """INSERT INTO changes (short_description) VALUES…
rdr
  • 49
  • 1
  • 10
2
votes
0 answers

Failed SQL conversion from smalldatetime to float

I am using pypyodbc to insert a new record into a MS SQL Server table with the parameterized query below. I've included table structure below. For the execute query, I've added inline comments of debug values at runtime. sql_statement = """ …
user1944673
  • 279
  • 1
  • 4
  • 13
2
votes
0 answers

How to connect remote SQL SERVER DB with python and convert tables into Pandas Data frame

I am using ubuntu and python3.5 Trying to connect with remote database with credentials(demo) jdbc_host = '57.56.254.98' jdbc_port = '21433' jdbc_user = 'username' jdbc_pass = "password" jdbc_dbname =…
Waqar
  • 817
  • 2
  • 8
  • 18
1 2
3
18 19