pyodbc

Failed to Login as 'Domain\ComputerName' pyodbc with py2exe

倾然丶 夕夏残阳落幕 提交于 2019-12-10 17:24:37
问题 Ok so I have a script that connects to a mssql db and i need to run as a service which I have already accomplished but when I run it as a service it overrides my credentials that I have put in when i connect to the db with the ad computer account. It runs perfect when i run it on its own and not as a service. My Connection String is: 'DRIVER={SQL Server};SERVER=MyServer;DATABASE=MyDB;UID=DOMAIN\myusername;PWD=A;Trusted_Connection=True' The Error is: Error: ('28000', "[28000] [Microsoft][ODBC

pyodbc install on IBM Bluemix server error

我怕爱的太早我们不能终老 提交于 2019-12-10 17:17:26
问题 I am trying to host my app on IBM bluemix. In my app, I have used flask and I am trying to Connect to Azure SQL Server database. So for that, I am using Pyodbc. So in requirement.txt file I have given pip install pyodbc and pip install flask . These things are getting installed on my local machine and the app is running fine. I am getting the result from the database . But when I am trying to deploy my application on IBM bluemix, while pushing the files on the server it is giving me an error.

Is it possible to specify the driver dll directly in the ODBC connection string?

梦想的初衷 提交于 2019-12-10 17:02:41
问题 I'm trying to use pyodbc to connect to a SQL Server (MS SQL Server through FreeTDS) in a portable application; since it's supposed to be standalone, I would like to avoid having to explicitly install the driver on the system, just bringing the ODBC driver dll along the application. This page suggests that it's possible to specify the driver dll directly in the connection string Specify the DRIVER= parameter in the szConnStrIn argument to the SQLDriverConnect function. For example: szConnStrIn

PyODBC Cursor.fetchall() causes python to crash (segfault)

风格不统一 提交于 2019-12-10 16:27:17
问题 I am using Python 2.7 on Windows XP. I have a simple python script on a schedule that uses pyodbc to grab data from an AR database which has worked perfectly until today. I get a segfault once the cursor reaches a particular row. I have similar code in C++ which has no problem retrieving the results, so I figure this is an issue with pyodbc. Either way, I'd like to "catch" this error. I've tried to use the subprocess module, but it doesn't seem to work since once the script hits a segfault it

Python: Pyodbc execute stored procedure with parameters

核能气质少年 提交于 2019-12-10 16:23:05
问题 I'm having trouble executing a SQL Server stored procedure with Python 3.4. I'm importing Pyodbc to create the connection and have a few lines that are supposed to sent data to a stored procedure. My Python: sql = "exec <stored_procedure_name> @int1=?, @int2=?, @string1=?, @int3=?" params = (irow[0], irow[15], irow[2], irow[6]) cursor.execute(sql, params) Stored Procedure: @int1 int, @int2 int, @string1 varchar(10), @int3 int AS BEGIN --Do stuff END I'm not getting an errors in Command Prompt

Issue with returning Cyrillic symbols from MSSQL via unixODBC and FreeTDS

扶醉桌前 提交于 2019-12-10 16:18:13
问题 I'm using django-pyodbc as database backend on Ubuntu 12.04 LTS and MSSQL 2008 on remote host. It works good except of returning Cyrillic symbols. Instead of them I see question marks - '?'. I have begin investigation what could cause this problem. As far as I understand MSSQL-django chain looks so: MSSQL <-> FreeTDS <-> unixODBC <-> pyodbc <-> django-pyodbc So I have started from FreeTDS. When I run query in tsql - it works good I can see all symbols including Cyrillic. The next one was isql

cx_freeze error with pyodbc

删除回忆录丶 提交于 2019-12-10 15:06:49
问题 if you have a simple program name pyodbcTest.py import pyodbc print "pass" and then use cx_freeze to compile it cxfreeze --targe-dir=cxTest pyodbcTest.py and then run that program it throws the following error. C:\temp\pythonWork\cxTest>pyodbcTest.exe Traceback (most recent call last): File "C:\Python27\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in <module> exec code in m.__dict__ File "pyodbcTest.py", line 1, in <module> RuntimeError: Unable to import decimal Any ideas?

Error loading pyodbc module while running on Apache

五迷三道 提交于 2019-12-10 14:39:57
问题 Previously I have been trying to host multiple DEMO django projects using a virtual host on apache, and have been successfully with the help of stackoverflow. Now I have been trying to host my new project using the same technique like the previous ones. My new project is connected to the sql_server database. My project runs perfectly when using djangos in-built server. When i try running using apache i get an 500 Internal Server Error and my apache error logs shows - Exception occurred

How to connect to windows SQL Server from Ubuntu

随声附和 提交于 2019-12-10 14:38:22
问题 For the past two days I have been trying to connect to a remote windows SQL server with no apparent success. I am trying to connect with python using the pyodbc package. I have tried following all the blog posts out there for that matter without much luck. I first followed that one which I think makes a good effort but ends up being too incoherent IMO. I have installed the unixODBC manager as proposed in the blog post. I have downloaded the available redhat packages from Windows and run the

How to get prepared query which is sent to db

泄露秘密 提交于 2019-12-10 13:32:30
问题 When using database libraries like pyodbc that implement the Python Database API Specification how can you get the fully prepared query after parameter substitution has been applied. I'm making a call to a Sybase stored procedure that will receive 18 arguments through parameter substitution. I would like to capture the actual call that was made and log it to help in debugging. A simpler example of what I need: pyodbc example import pyodbc conn = pyodbc.connect('DSN=test;PWD=password') c =