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
0
votes
2 answers

Python filter one list based on values that do not exist in another list

Trying to filter results of a query on a Table A by 2 values not found in a Table B. What would be the proper syntax and approach? import pyodbc MDB = 'C:/db/db1.mdb'; DRV = '{Microsoft Access Driver (*.mdb)}'; PWD = 'pw' con =…
BKCapri
  • 548
  • 2
  • 8
  • 21
0
votes
1 answer

MSAccess update statement with string containing special characters and spaces

I am trying to update rows in a column in MS Access using Python. The string I want to update is a Windows file path which contains special characters and spaces…
Manish Gupta
  • 4,438
  • 18
  • 57
  • 104
0
votes
1 answer

Run Python script with MSSQL-database connection on Ubuntu Server

Im trying to run a script i wrote on a Ubuntu Server. Im using pypyodbc to connect to a database on a server in the script, and it works great on Windows. When im trying to run it on my Ubuntu Server i get the following error: pypyodbc.Error:…
Stains
  • 97
  • 1
  • 12
0
votes
1 answer

pypyodbc : Issue

I am trying to extract data from a SQL Server Database using pypyodbc. But it appears my code breaks when I try to construct the SELECT Statement using myCursor.execute(SQLCommand,values) Can anyone spot an issue and point me in the right…
Steve
  • 475
  • 4
  • 12
  • 25
0
votes
1 answer

ODBC access from Mac install of Python to Access database installed in Parallels

I want to link my Python packages to my Access database, but I get this error. I use python 2.7.12 (shell). import pypyodbc #create connection con = pypyodbc.connect('DRIVER={Microsoft Access-Treiber…
0
votes
0 answers

pypyodbc and pyodbc - MS SQL Server - escape in query does not work

What is the proper way to escape input using pyodbc or pypyodbc? I have two examples using ? and using %s. Which is preferred, and why don't both examples work? First example using ? cnxn = pyodbc.connect('DRIVER={SQL…
dev
  • 1,119
  • 1
  • 11
  • 34
0
votes
1 answer

pypyodbc execute delete query error "Function sequence error"

I was able to execute the delete SQL query in Python with pypyodbc as below cur.execute("delete from table_a where a ='a';").commit() However, I failed to run the delete SQL with a subquery cur.execute("delete from table_a where a in ( select a…
Decula
  • 494
  • 4
  • 16
0
votes
0 answers

Python ODBC Connection as a global variable

So I am using pypyodbc to connect to a SQL Server Database. For my code to work properly I believe the easiest and most efficient practice would be to open the connection and retrieve the data as a global variable. However, I vaguely remember…
0
votes
0 answers

Connect sql default username with python

I'm trying to connect sql server to python script when I try to make a new username it doesn't work when i try to connect to it by the managment studio it doesn't run only with the default username SQLEXPRESS i don't know how to connect i tried to…
0
votes
1 answer

Same code inserts data into one database but not into another

I am facing a strange problem right now. I am using pypyodbc to insert data into a test database hosted by AWS. This database that I created was by hand and did not imitate all relations and whatnot between tables. All I did was create a table with…
0
votes
1 answer

TypeError: 'type' object is not subscriptable with pypyodbc (Python)

What is wrong with my below python code ? I want to connect to my database, select some information. These are in a list of list, I grab the list and I do a "select..from..where..IN" : import pypyodbc connection = pypyodbc.connect('Driver={SQL…
blabla
  • 402
  • 2
  • 10
  • 17
0
votes
1 answer

PyODBC, cursor.execute() won't insert parameters into SQL String

I am using pypyodbc to insert data into a database and when I use the cursor.execute() command I try to put the sql string and the parameters, but I get the following error: SELECT uid FROM HP_DATA WHERE( hpName = ? AND processID = ? AND…
M. Barbieri
  • 512
  • 2
  • 13
  • 27
0
votes
1 answer

Pypyodbc pulling SQL Column as value

I am using pypyodbc to pull data but I will simplify the data for this example. My issue is that I have a column named 475Election and when I pull data from this column I am getting 475 as a value in python. For example: TradeID ...Other…
0
votes
1 answer

Replacing Bad Data in Pandas Data Frame

In Python 2.7, I'm connecting to an external data source using the following: import pypyodbc import pandas as pd import datetime import csv import boto3 import os # Connect to the DataSource conn = pypyodbc.connect("DSN = FAKE DATA SOURCE;…
user2752159
  • 1,182
  • 3
  • 13
  • 29
0
votes
1 answer

how to use value from a mssql query in a sqlite query

I have two tables, one in ms sql and other one in sqlite3 I need to update a field in mssql table to the related value from sqlite3 table. here is my code: import pypyodbc import sqlite3 connection = pypyodbc.connect('Driver={SQL Server};' …
Muhammad Naderi
  • 3,090
  • 3
  • 24
  • 37