Category Archives: adodbapi

Integrated SSPI security via python ADODBAPI works on command line but not Apache CGI

I have a python script that accesses a corporate MS-SQL database on the local network using adodbapi. It works fine via the command line, but when I try to access it via cgi from an Apache server in Windows 7, I get an Apache error that seems to suggest a possible failure of authentication:

[Wed Jan 25 01:29:26.872021 2017] [cgi:error] [pid 9092:tid 924] [client ::1:51068] AH01215: adodbapi.apibase.OperationalError: (InterfaceError("Windows COM Error: Dispatch('ADODB.Connection') failed.",), 'Error opening connection to "Provider=sqloledb;\nData Source=#####;\nInitial Catalog=#####;\nIntegrated Security=SSPI\n"'): C:/Apache/Apache24/htdocs/GetJobInfo.py

I have gone through available troubleshooting resources and the best I can think of is a network permission issue. I set the Apache service Log On As user to the same user I'm using to run the python script on the command line and get the same issue.

Should I be using the mod_auth_sspi module for Apache to make this work? I am not interested in using "pass-through" authentication through the web but would rather just access the database from the same user. What else could be preventing the adodb api from connecting?