Build, protect and deploy apps across any platform and mobile device
Deliver Awesome UI with the most complete toolboxes for .NET, Web and Mobile development
Automate UI, load and performance testing for web, desktop and mobile
Rapidly develop, manage and deploy business apps, delivered as SaaS in the cloud
Automate decision processes with a no-code business rules engine
Build mobile apps for iOS, Android and Windows Phone
A complete cloud platform for an app or your entire digital business
Deploy automated machine learning to accurately predict machine failures with technology optimized for Industrial IoT.
Optimize data integration with high-performance connectivity
Connect to any cloud or on-premises data source using a standard interface
Build engaging multi-channel web and digital experiences with intuitive web content management
In this tutorial, learn how to install and use a DataDirect ODBC driver, Python and pyodbc. Code samples are included.
Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum and first released in 1991.
Pyodbc is an open source Python module that makes accessing ODBC databases simple. It implements the DB API 2.0 specification. Using pyodbc, you can easily connect Python applications to data sources with an ODBC driver.
As with other application stacks connecting through the ODBC API, the application—in this case your python code along with the pyodbc module—will use an ODBC driver manager and ODBC driver. The ODBC driver manager is platform-specific, while the ODBC driver is database-specific. The ODBC driver manager and driver will connect, typically over a network, to the database server.
For more information on pyodbc, see the Github Pyodbc Wiki.
Once a connection has been established, your application can execute selects, inserts, or other ODBC operations supported by your driver and database.
We've written a tutorial to show you how to install a DataDirect ODBC driver, Python and pyodbc. We've also provided a code sample demonstrating a connection to Microsoft SQL Server using the Python ODBC interface via the Progress DataDirect Connect64 for ODBC SQL Server Wire Protocol driver.
While this tutorial uses a simple code sample to connect and demonstrate basic operations, we recommend that you fully test your ODBC driver with the complete set of operations you expect to use in your production application. A quick test connection can demonstrate that connectivity has been successfully established, but won't necessarily test all the operations and load used by a full application.
Our tutorial demonstrates a connection to SQL Server with pyodbc, but you can use the same steps to connect to any data source using a DataDirect ODBC driver. Instead of using a data source, the code can also be modified to pass a connection string to the pyodbc.connect() function for DSN-less connections.
Download a free 15 day trial of DataDirect ODBC drivers. Then follow our tutorial to connect to your database using Python and pyodbc.
Start the Tutorial
Saikrishna is a DataDirect Developer Evangelist at Progress. Prior to working at Progress, he worked as Software Engineer for 3 years after getting his undergraduate degree, and recently graduated from NC State University with Masters in Computer Science. His interests are in the areas of Data Connectivity, SaaS and Mobile App Development.
Copyright © 2017 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.