Category : odbc

The following script connects to two databases, when it executes the update statement, the script crashes with> Exit code: 3221225477 #!/usr/bin/env python # -*- coding: iso-8859-1 -*- import sys reload(sys) sys.setdefaultencoding(‘iso-8859-1’) import pyodbc print("pyodbc " + pyodbc.version) import locale locale.setlocale(locale.LC_ALL, ”) import datetime database = "W:ARCHIVIELISA.DBD" #first Database user = "user" password = "password" connessione ..

Read more

I am newbie to sql query .. I am writing code and querying database in python.. Below is my code and I am not sure about the problem with the code: import pyodbc import pandas as pd import numpy as np #import datetime from pandas import ExcelWriter from pandas import ExcelFile df_lots=pd.DataFrame() sql = """ ..

Read more

I am trying to export a Dataframe to MS Azure DB table using sqlalchemy Below is the code, import sqlalchemy import urllib import pyodbc from sqlalchemy import event params = urllib.parse.quote_plus("Driver={ODBC Driver 17 for SQL Server};Server=tcp:***.database.windows.net,1433;DATABASE=***;UID=***@xyz.com;PWD=***;Authentication=ActiveDirectoryPassword") engine = sqlalchemy.create_engine("mssql+pyodbc:///?odbc_connect=%s" % params) df = pd.read_csv(r’C:Userspathaaa.csv’) @event.listens_for(engine, ‘before_cursor_execute’) def receive_before_cursor_execute(conn, cursor, statement, params, context, executemany): if executemany: ..

Read more

I am trying to get pyodbc to connect to SQL Server with this test script: import pyodbc server = ‘ms.sql.server’ database = ‘database’ username = ‘username’ password = ‘password’ print(pyodbc.drivers()) drivers = [item for item in pyodbc.drivers()] driver = drivers[-1] print(‘driver:’+driver) cnxn = pyodbc.connect(‘DRIVER={‘+driver+’};SERVER=’+server+’;DATABASE=’+database+’;UID=’+username+’;PWD=’+ password) cursor = cnxn.cursor() #Sample select query cursor.execute("SELECT loginame FROM sys.sysprocesses ..

Read more

I am connecting to an Azure SQL database using pyodcb. We have multi-factor authentication enabled, so I am using ActiveDirectoryInteractive authentication. We also use single sign-on for Windows. My code is as follows: import pyodbc driver = ‘{ODBC Driver 17 for SQL Server}’ server = ‘xxxxxxxxxxxxx.database.windows.net’ database = ‘xxxxxxxxxxxxx’ authentication = ‘ActiveDirectoryInteractive’ username = ‘xxxxxxxxxxxxx’ ..

Read more

I’m testing an API using Fast API and Docker. When I load up the webpage it attempts to run a query using an AS400 connection that is setup with pyodbc. I started with the error: pyodbc.InterfaceError: (‘28000’, ‘[28000] [IBM][System i Access ODBC Driver]Communication link failure. comm rc=8051 – CWBSY1011 – Kerberos client credentials not found ..

Read more

I’m trying to read data from Aspench IP21 database (windows 10). I have tested ODBC driver with excel and it works nice. But when I try to test pyodbc to do same I get following error message: import pypyodbc conn = pypyodbc.connect("DRIVER={AspenTech SQLplus};HOST=10.10.10.10;PORT=10014") Error: (‘IM003’, ‘[IM003] Specified driver could not be loaded due to system ..

Read more

We are using the Snowflake ODBC Driver to connect to our warehouse from a series of different, completely unrelated backends. We have Alteryx workflows and Python applications connecting to the warehouse through ODBC. We can successfully establish a connection and access the information in our databases, however, there is a hard limit of 1000000 when ..

Read more