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

I have error "TypeError: 'type' object is not subscriptable"

I want to add data to Access by writing it in form of tkinter but I have a mistake. What's wrong? I tried to change the place of con.close () but it doesn't help, I even have another mistake if I put it before def from tkinter import * import…
Baga
  • 39
  • 1
  • 6
0
votes
1 answer

Return single string from pypyodbc database query

I'm trying to pull a single value back from a MSSQL DB, the code looks like: import pandas as pd import pypyodbc query = 'SELECT TOP(1) value FROM [dbo].[table]' connection = pypyodbc.connect(...) df = pd.read_sql_query(query, connection) But this…
Zach Cleary
  • 458
  • 1
  • 4
  • 17
0
votes
2 answers

Python error updating a SQL DB

I have some python code that looks like this import pypyodbc import pandas as pd home="c:/SQL/" df = pd.read_sql_query(sql4, conn3 for y1 in range(0 , k): ARCHIVE_SERNUM = (df['sernum']).iloc[y1] KQL=len(KIC53_QUERY_LIST) FOUND=False …
C0ppert0p
  • 634
  • 2
  • 7
  • 23
0
votes
1 answer

Getting NameError: free variable referenced before assignment, but cannot see where I've done so

I am trying to create a basic log in frame for my application (not worrying about it being complicated at all, it's for an A Level project). In the checklogin function, I am trying to retrieve the username input by the user, and seeing if it is in…
tdbridger
  • 59
  • 1
  • 6
0
votes
1 answer

Error in MS Access SELECT statement when number symbol (#) present

When running this minimal code: import pypyodbc conn = pypyodbc.connect(r'Driver={{Microsoft Access Driver (*.mdb, *.accdb)}}; Dbq=C:\temp\example.accdb;' cur = conn.cursor() cur.execute('SELECT [Pass#] FROM [Companies]') I get the following…
Roadrunner-EX
  • 824
  • 11
  • 23
0
votes
1 answer

Python flask azure connection and driver needed azure driver needed

How do I find the SQL azure driver for my pypyodbc application. [gte 2.0] --> Content relevant to Named Framework versions 2.0 and greater.
0
votes
1 answer

Python pypyodbc search value in Access database and select the field

I am using Python pypyodbc to connect to the Microsoft Access database. I am able to connect to database as well. Table name is "CODES" and looks like this : Field1 Field2 U1A17 High Speed Link U1A17 Low Speed Link Now the value of…
0
votes
0 answers

pypyodbc "Too few parameters" error

I'm being forced to use python and pyodbc to do some basic database work and am encountering the following error which is confusing me: pypyodbc.DatabaseError: ('07002', '[07002] [Microsoft][ODBC Microsoft Access Driver] Too few parameters.…
ScottishTapWater
  • 3,656
  • 4
  • 38
  • 81
0
votes
1 answer

How to prevent 'NoneType' object is not subscriptable error' when MS SQL does not contain data in the table?

Currently I get a ''NoneType' object is not subscriptable error' if I search for data that is not in the MS SQL table. Instead of stopping Python and outputting this error, I just want it to state that the 'data does not exist' and request another…
Prox
  • 699
  • 5
  • 11
  • 33
0
votes
1 answer

pypyodbc connects with explicit string but not variable

I'm reading a connection string for an SQL Server database from the user, represented by randomstring here. When I print randomstring to the console it looks perfectly formed, and I've been over it a dozen times to check. However, the connection…
pickarooney
  • 385
  • 2
  • 18
0
votes
0 answers

pypyodbc datetime conversion

I'm trying to call a 3rd party stored procedure on a MS SQL server. The stored procedure has an ALTER PROCEDURE block at the start containing this line: @EffDate DateType = NULL, I'm trying to call it from this script (python2.7 on…
0
votes
1 answer

Formatting CSV file created using pypyodbc

I'm using the following code to query a SQL Server DB, and storing the returned results in a CSV file. import pypyodbc import csv connection = pypyodbc.connect('Driver={SQL Server};' 'Server=localhost;' …
ThatRiddimGuy
  • 381
  • 2
  • 6
  • 19
0
votes
1 answer

ODBC Library Not Found error

I've written a python script on my raspberry pi (OS: Raspbian) that I intend to use to populate a table in an MSSQL database, but I'm getting an error when trying to connect to it. I'm using pypyodbc to achieve what I want. My connection string…
Mat Richardson
  • 3,576
  • 4
  • 31
  • 56
0
votes
0 answers

PYODBC Insert Into Database - Error: Optional Feature Not Implemented (0) (SQLBindParameter)

I am currently trying to use pyodbc to select data from a table within Database A and insert it into a table within Database B. I was able to establish connections with both databases, so I know there is no error there. Additionally, my first…
ls101
  • 177
  • 5
  • 17
0
votes
2 answers

Connecting to SQL Server Using pypyodbc

I'm attempting to access an SQL in python using pypyodbc, here is the code I've got: import pypyodbc as pyodbc db_host = host db_name = name db_user = user db_password = password connection_string = ("DRIVER={SQL Server};SERVER=" + (db_host) +…
J. Whitehead
  • 451
  • 4
  • 21