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

inserting date time with microsecond into SQL Server from python

Below code works perfectly: import pypyodbc import datetime connection = pypyodbc.connect('Driver={SQL Server};' 'Server=some_server;' 'Database=some_db') cur = connection.cursor() some_time = datetime.datetime.utcnow().strftime('%Y-%m-%d…
user1700890
  • 7,144
  • 18
  • 87
  • 183
0
votes
3 answers

python sql connection - pypyodbc - sequence item 0: expected str instance, bytes found

I have a function which, when passed database, table and access details connects to a table in SQL server to read all the contents to export to a pandas dataframe def GET_DATA(source_server, source_database, source_table, source_username,…
the_good_pony
  • 490
  • 5
  • 12
0
votes
1 answer

pyodbc calling Stored Procedures error

When calling stored procedure with pyodbc it return nothing, and therefore cursor.fetchall() gives error: ProgrammingError Traceback (most recent call last) in () ----> 1…
user1889297
  • 464
  • 5
  • 13
0
votes
1 answer

SQL Server float unstable last digits

In SQL Server I create an aggregated column (a combination of other columns that I add, multiple, sum etc) which is of SQL datatype float. However, when I run the same query multiple times, the last 2 digits of my float are unstable and keep…
Kai Aeberli
  • 1,189
  • 8
  • 21
0
votes
0 answers

Setting Default value for column in MS access using sql query in Python

I am using pypyodbc(python 64bit) to connect to MS access(64 bit) for my project. Using SQL query ( such SET DEFAULT, DEFAULT=0) i have to set column to the default values. But query results in string error. I donot want to use OLE DB. Is there any…
0
votes
1 answer

python translate bytecode to utf-8 using a variable

I have the following problem: From a SQL Server database I am reading data using python module pypyodbc and ODBC Driver 13 for SQL Server and writing to txt files. Database contains all kinds of special characters and they read…
Marc Enthoven
  • 11
  • 1
  • 3
0
votes
1 answer

Python connecting to Access Database using pypyodbc: No default driver specified

I am trying to get data from a very simple Access file into a python code. I followed the directions in this video: https://www.youtube.com/watch?v=zw9P2wSnoIo My code is as follows: import pypyodbc con=pypyodbc.connect('DRIVER={Microsoft Access…
SGray2
  • 19
  • 1
  • 4
0
votes
0 answers

Cannot make connection to .accdb file using python

I am writing a script that needs to make a connection to a microsoft access .accdb file and extract data from it. Here is a snippet of what I am doing? import pypyodbc pypyodbc.lowercase = False conn = pypyodbc.connect( r'DRIVER={Microsoft…
sshussain270
  • 1,785
  • 4
  • 25
  • 49
0
votes
1 answer

Conflicting dependencies of pypyodbc and blpapi

I have a conda environment where I have installed pypyodbc and now I am trying to install the blpapi package with the following command: conda install -c dsm blpapi Solving environment: failed UnsatisfiableError: The following specifications were…
Mace
  • 1,259
  • 4
  • 16
  • 35
0
votes
0 answers

Pypyodbc invalid argument type

I'm trying to query a database with the following code: def check_entry(self, contest_id, number): print("Contest id: {0}, Number: {1}".format(contest_id, number)) self._db_cursor.execute("""SELECT * FROM Entry WHERE ContestID LIKE ? AND…
M Dillon
  • 164
  • 1
  • 8
0
votes
1 answer

Pypyodbc: Executing stored procedure in a loop where the store procedure is saved in a table

I have a table which has data which looks like below Name Query RunDate SP Some_sp 12/25/2017 Sp1 Some1_sp 12/25/2017 sp_2 Some2_sp 12/25/2107 Query column has the stored procedure to be executed. def __init__(self): …
dvsn
  • 17
  • 7
0
votes
0 answers

SQL query to insert image file into MSSQL database using API: Python

In query sheet of MSSQL Server 2017 when we execute this command insert into Register1 (logo) SELECT BulkColumn FROM Openrowset( Bulk 'C:\\Users\Vitriv-Desktop\Desktop\Capture.JPG', Single_Blob) as img Result: (1 row affected) From python shell:…
Nɪsʜᴀɴᴛʜ ॐ
  • 2,756
  • 4
  • 33
  • 57
0
votes
1 answer

Connecting to MSSQL Server 2017 from Apache HTTP Server via python script

What should be my configuration to connect with Apache from the below configuration: SERVER : DESKTOP-C6RS3DO User Name : (Default:blank) Password : (Default:blank) Connection: DESKTOP-C6RS3DO\Vitriv-Desktop Even server Authentication…
Nɪsʜᴀɴᴛʜ ॐ
  • 2,756
  • 4
  • 33
  • 57
0
votes
0 answers

Python code works outside a function but not in a function

I'm new to Python. Only been coding a month. I am stumped. The below code works perfectly until I move it to a function. I'm not at work so I can't remember the exact error, but it was something about no temp registry access. The exact error is not…
Eddie Snipes
  • 119
  • 1
  • 1
  • 8
0
votes
3 answers

How to ignore "IndexError: list index out of range" on SQL Execute Insert statement

I am working with Python 2.7 to extract data from a JSON API and push it into a SQL-Server table. I am having trouble with inserting data into the database where some of the entries returned from the JSON response are missing a section of the…
Phil Baines
  • 437
  • 1
  • 6
  • 18