making DB queries from Linux to windows using python pyodbc
Hello Guys, im a real newbie in this, but however, what im trying to do is i want to connect to a DB in a windows machine from my linux Opensuse13.2, using python pyodbc. below is my code :
Code:
pyodbc.connect('DRIVER={SQL Server};SERVER=servername;DATABASE=dbname;UID=userid;PWD=password') and below is my odbcinst.ini file : Code:
[Easysoft ODBC-SQL Server] |
Quote:
Quote:
https://mkleehammer.github.io/pyodbc/ |
i'm marking this as solved.
it is not really a question related to python. realizing the fact that i'm working with python for the past 4 years, of course i imported the pyodbc script. otherwise the failure message would have been different. its a question related to Linux ODBC driver configuration... just in case anyone came across this problem, this is how i solved my problem. for some reason, after installing an ODBC driver, (here's a link for an ODBC driver, that works like a champ : https://blogs.msdn.microsoft.com/dil...on-suse-linux/) the odbc.ini and odbcinst.ini files were located at /etc/. however, to make sure the location is correct, please run this command : "odbcinst -j", and you will see below output : Code:
MyTester:~ # odbcinst -j so basically, in my case, the files should be at /etc/unixODBC/odbcinst.ini/ instead of /etc/. so i just copied the files to /etc/unixODBC/odbcinst.ini/ and it works! good luck guys |
All times are GMT -5. The time now is 03:53 AM. |