0

I am trying to connect to a database server from my 64-bit Windows client machines. I tried to connect with adodbapi and it failed.

Jamal
  • 763
  • 7
  • 22
  • 32
prathima
  • 113
  • 2
  • 9
  • 1
    In short, yes. [Try it](https://github.com/mkleehammer/pyodbc/wiki/Getting-started) and post a new question if you need help with a specific issue. [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask) – Bryan May 09 '16 at 14:37
  • 1
    Also, if you're having problems getting `pyodbc` to work, please show your homework. :) – FlipperPA May 09 '16 at 19:20
  • You can encounter issues on a 64-bit system if your Python build or applicable libraries are 32-bit. Check that your python, pyodbc, pywin32 (or adodbapi) are all 64 bit. May not be the core issue, but easy to rule out. – jdg May 09 '16 at 19:25

1 Answers1

1

pyodbc (or pypyodbc) can do be used to set up the connection.

The accepted answer to pyodbc requires python 3.3 describes how to install pyodbc. Also posted there is my experience (an exception was thrown) when using that method to successfully install 64-bit pyobdc for Python 3.5.1.on Win 7 Enterprise SP1.

Here's a summary of the method:

1 - Go to Chris Gholke's site: http://www.lfd.uci.edu/~gohlke/pythonlibs/ (which has Windows versions of many packages) and download the 64 bit pyodbc package (for 3.x: pyodbc-3.0.10-cp35-none-win_amd64.whl, for 2.7: pyodbc-3.0.10-cp27-none-win_amd64.whl)

2 - Open a command line window and perform the remaining steps inside that window.

3 - Move (cd) to the Scripts folder located beneath your python installation folder. In the posted example this was C:\python\64-bit\Scripts.

4 - Run pip to see what's already installed:

pip list

5 - If wheel is not listed you will need to install it before installing pyobdc:

pip install wheel     

Which installs wheel directly off the web (you could download and install as per the next step)

6 - Use pip to install pyodbc:

pip install <path to your download folder>\pyodbc-3.0.10-cp35-none-win_amd64.whl  - change name for 2.7

7 - You may get an exception (documented with the example) but it doesn't seem to matter. Confirm installation by entering:

pip list

8 - Use pyobdc.

Community
  • 1
  • 1
user1459519
  • 712
  • 9
  • 20