2

This is the error I am getting when I run the django web server.

django.db.utils.OperationalError: (com_error(-2147352567, 'Exception occurred.', (0, u'Microsoft OLE DB Provider for SQL
 Server', u'Invalid connection string attribute', None, 0, -2147217843), None), u'Error opening connection: DATA SOURCE=
server1;Initial Catalog=Misc;UID=DOMAIN\\dcullen;PWD=******;PROVIDER=SQLOLEDB;MARS Connection=True')

settings.py

...
DATABASES = {
    'default': {
        'NAME': 'Misc',
        'ENGINE': 'sqlserver_ado',
        'HOST': 'server1',
        'USER': 'DOMAIN\\dcullen',
        'PASSWORD': 'PWD',
        'OPTIONS': {
            'provider': 'SQLOLEDB',
            'use_legacy_date_fields': 'True'
        }
    }
}
...

connection-strings.com seems to indicate that the driver is not for SQL Server 2012 but SQL Server 2000.

Python version: 2.7 Django version: 1.7.11 django-mssql version: 1.7

Package homepage: https://bitbucket.org/Manfre/django-mssql/

2 Answers 2

1

I found the answer now, I was using the wrong provider.

Changing to Provider=SQLNCLI11 solved the issue.

Sign up to request clarification or add additional context in comments.

Comments

0

try these settings. Hope this helps

DATABASES = {
    'default': {
        'ENGINE': 'sqlserver_ado',
        'NAME': '',
        'USER': '',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '1433',
         'OPTIONS': {
            'provider': 'SQLOLEDB', #SQLNCLI11 , SQLOLEDB
            'use_legacy_date_fields': 'True',
            #'extra_params' : 'DataTypeCompatibility=80;MARS Connection=True',
            #'connect_timeout': 0
            }
    }
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.