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
1
vote
1 answer

invalid literal for int() with base 10 pypyodbc

While I'm connecting to HFSQL database to retrieve a set of data using pypyodbc module in python with the following code import pypyodbc connection = pypyodbc.connect( "DSN=odbc_name" ) cursor = connection.cursor() cursor.execute( "select * from…
rachid el kedmiri
  • 2,376
  • 2
  • 18
  • 40
1
vote
0 answers

to_sql - "cannot use a string pattern on a byte-like object"

I am trying to use pandas, sqlalchemy and pypyodbc in order to write my dataframe (df2) to a table in my sql database. I have successfully connected to the database with pypyodbc. However, when I try to use the engine with to_sql it throws the error…
Pete
  • 11
  • 2
1
vote
1 answer

Escaping characters in SQL string for pypyodbc

Suppose I have my_table in SQL Server like this: CREATE TABLE my_table (col1 VARCHAR(100), col2 VARCHAR(100), col3 INT) I tried to insert a few records to that table using Python 3.5 and pypyodbc library as shown below: import…
user1330974
  • 2,500
  • 5
  • 32
  • 60
1
vote
1 answer

pypyodbc - Invalid cursor state when executing stored procedure in a loop

I have a python program which uses pypyodbc to interact with MSSQL database. A stored procedure is created in MSSQL and is run via python. If I execute the stored procedure only once (via python), there are no problems. However, when it is…
1
vote
1 answer

FreeTDS configuration on MacOS without .so files

Can anyone point me to how to setup an ODBC connection to a MS SQL Server using FreeTDS? All of the posts and items I found on the web so far require the .so file which is no longer generated (or required) when installing FreeTDS according to its…
Andre Guerra
  • 1,117
  • 1
  • 9
  • 18
1
vote
2 answers

How to connect oracle database with python pypyodbc

I am trying to connect an oracle database from my python code using pypyodbc: conn_string = "driver={Oracle in OraClient11g_home1}; server='example.oneco.com:1521'; database='tabto'; uid='myuid'; pwd='mypwd'" conn = pypyodbc.connect(conn_string) I…
ju.
  • 1,016
  • 1
  • 13
  • 34
1
vote
1 answer

Use SQL 'like' in Pandas with input()

so I'm using the code below to SELECT columns FROM a certain table in SQL Server. sus_base = pd.read_sql_query("SELECT screen_name, user_id, text FROM [dbo].[TABLE_ONE]", con) df1 = pd.read_sql_query("SELECT screen_name, user_id, text FROM…
user6533517
  • 25
  • 1
  • 6
1
vote
0 answers

python:Data insertion error in SQL Server

I have data that I need to insert into SQL Server in a list values = [('Hello', 'McDonald'), ('Hi', 'Jennifer'), ('Ola', 'Janice'),('Hey', 'Bob')] And I' trying to insert this using the following command: columns_list_template =…
1
vote
0 answers

PyPyODBC with Access 2013

I'm trying to connect to an Access database using ODBC and if I ask for a list of DNS providers the access driver is listed, but it won't accept it being used in the query. I've checked and I have 32bit drivers, Access and Python (and querying the…
1
vote
1 answer

Inserting formatted string with single quotes with Pypyodbc

I'm trying to insert a network path as a string value using Pypyodbc: def insert_new_result(self, low, medium, high, reportpath): reportpath = "'" + reportpath + "'" self.insertsql = ( """INSERT INTO [dbo].[Results]…
3lysium
  • 103
  • 3
  • 13
1
vote
2 answers

pypyodbc - Access Driver is not found

i want to work with pypyodbc and whenever I use win_create_mdb I get the error Exception: Access Driver is not found. I have installed Access Database Engine 32-bit, since my MS products are 32-bit. Any thoughts?
nvrslnc
  • 349
  • 1
  • 5
  • 17
1
vote
1 answer

How to pass a date variable to an SQL query in Python

Python3.5 Sql Server 2012 Standard package is pypyodbc This Code Works myConnection = pypyodbc.connect('Driver={SQL Server};' 'Server=myserver;' 'Database=mydatabase;' …
pbean
  • 15
  • 1
  • 6
1
vote
1 answer

Modify values in an existing table of MS Access using Python

I am trying to change a value of a whole column in MS Access database with python using pypyodbc. So far I have only found a way to create a new line but not modify the existing values. This code is from another question I found and it works but…
A.Linnet
  • 63
  • 6
1
vote
1 answer

Retrieving data from MS Access database in UTF-8

I am using Python 2.7 to access a database in MS Access with pypyodbc. However, my list is in Unicode instead of utf8 My code is as follows: listofvariants=list() conn=pypyodbc.win_connect_mdb("C:\Users\Database.mdb") cursor =…
A.Linnet
  • 63
  • 6
1
vote
2 answers

Python to SQL Server connection

I'm using Python 3.5.1 with Anaconda package 2.4.0 and try to make a connection to local SQL Server (2008 R2) So doing the next things: import pypyodbc connection_string =pypyodbc.connect('Driver={SQL…
Keithx
  • 2,994
  • 15
  • 42
  • 71