title: Error "sqlserver_ado isn't an available database backend" (PyISAPIe on IIS)
body: <p>I'm having problems connecting my Django project to SQL Server 2008 when using IIS to serve Django and <a href="http://django-mssql.readthedocs.org/en/latest/index.html" rel="nofollow noreferrer">django-mssql</a> to handle transactions.  I am using IIS 7 and <a href="http://www.activestate.com/activepython/downloads" rel="nofollow noreferrer">64 bit ActivePython 2.7</a>. </p>
  
  <p>Here is my list of installed packages:</p>
  
  <pre><code>Django==1.4.5
  distribute==0.6.19
  django-mssql==1.2
  pypm==1.3.4
  pythonselect==1.3
  pywin32==214
  virtualenv==1.6.1
  wsgiref==0.1.2
  </code></pre>
  
  <p>And here is the last bit of the stack trace:</p>
  
  <pre><code>  File "C:\Python27\lib\site-packages\django\db\__init__.py", line 40, in 
      backend = load_backend(connection.settings_dict['ENGINE'])
    File "C:\Python27\lib\site-packages\django\db\__init__.py", line 34, in __getattr__
      return getattr(connections[DEFAULT_DB_ALIAS], item)
    File "C:\Python27\lib\site-packages\django\db\utils.py", line 92, in __getitem__
      backend = load_backend(db['ENGINE'])
    File "C:\Python27\lib\site-packages\django\db\utils.py", line 51, in load_backend
      raise ImproperlyConfigured(error_msg)
  django.core.exceptions.ImproperlyConfigured: 'sqlserver_ado' isn't an available database backend.
  Try using django.db.backends.sqlserver_ado instead.
  Error was: DLL load failed: The specified module could not be found.
  </code></pre>
  
  <p>If I add the <code>sqlserver_ado</code> folder to <code>C:\Python27\Lib\site-packages\django\db\backends</code> and change my database settings in <code>settings.py</code> from <code>'ENGINE': 'sqlserver_ado',</code> to <code>'ENGINE': 'django.db.backends.sqlserver_ado',</code>, then I get a slightly different stack trace.</p>
  
  <pre><code>  File "C:\Python27\lib\site-packages\django\db\backends\sqlserver_ado\base.py", line 6, in 
      import dbapi as Database
    File "C:\Python27\lib\site-packages\django\db\backends\sqlserver_ado\dbapi.py", line 49, in 
      import pythoncom
    File "C:\Python27\lib\site-packages\pythoncom.py", line 2, in 
      import pywintypes
    File "C:\Python27\lib\site-packages\win32\lib\pywintypes.py", line 124, in 
      __import_pywin32_system_module__("pywintypes", globals())
    File "C:\Python27\lib\site-packages\win32\lib\pywintypes.py", line 64, in __import_pywin32_system_module__
      import _win32sysloader
  ImportError: DLL load failed: The specified module could not be found.
  </code></pre>
  
  <p>If I connect to a sqlite database instead of SQL Server, the application works fine.<br>
  If I run the project using the development server, connecting to SQL Server works fine.<br>
  So it seems the problem is the combination of IIS / PyISAPIe and django_mssql.</p>
  
  <p>Several other questions have mentioned similar issues.  Each of these were solved by somehow getting python dlls on the system path.  I tried (both by checking the path and copying the files into <code>c:\python2.7</code>, but I get the same error.</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/13965251/django-error-in-apache-2-2-database-backend-fails-in-production-but-successful">https://stackoverflow.com/questions/13965251/django-error-in-apache-2-2-database-backend-fails-in-production-but-successful</a></li>
  <li><a href="https://stackoverflow.com/questions/7755626/pywintypes27-dll-not-found-using-apache-django-pywin32-python2-7-and-mod-wsgi">pywintypes27.dll not found using Apache, Django, pywin32, Python2.7 and mod_wsgi</a></li>
  <li><a href="http://code.google.com/p/django-mssql/issues/detail?id=107" rel="nofollow noreferrer">http://code.google.com/p/django-mssql/issues/detail?id=107</a></li>
  </ul>
  
  <p>For a last bit of info, here is <code>sys.path</code> for the development server version and the IIS / PyISAPIe version.</p>
  
  <p>Development (works):</p>
  
  <pre><code>C:\Users\Administrator\Desktop\django test C:\Python27\python27.zip C:\Python27\DLLs C:\Python27\lib C:\Python27\lib\plat-win C:\Python27\lib\lib-tk C:\Python27 C:\Users\Administrator\AppData\Roaming\Python\Python27\site-packages C:\Python27\lib\site-packages C:\Python27\lib\site-packages\win32 C:\Python27\lib\site-packages\win32\lib C:\Python27\lib\site-packages\Pythonwin C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg-info
  </code></pre>
  
  <p>IIS (fails):</p>
  
  <pre><code>C:\PyISAPIe C:\Windows\system32\python27.zip C:\Python27\Lib C:\Python27\DLLs C:\Python27\Lib\lib-tk c:\windows\system32\inetsrv C:\Python27 C:\Python27\lib\site-packages C:\Python27\lib\site-packages\win32 C:\Python27\lib\site-packages\win32\lib C:\Python27\lib\site-packages\Pythonwin C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg-info c:\inetpub\PyApp
  </code></pre>
  
  <p>Any tips or suggestions of where to go from here would be appreciated.  I'm going to try out normal (i.e. non-Active) Python next to see if that makes a difference.</p>