Monday, March 22, 2021

Connect Django with SQL Server 2012

Hello,
I have a problem tryng to connect Django with a SQL Server 2012 runnig
on my pc.
I installed pyodb package and this is my connection parameters in
settings.py

DATABASES = {
    'default': {
        'ENGINE': "sql_server.pyodbc",
        'NAME': "CD",
        'USER': "sa",
        'PASSWORD': "secret",
        'HOST': "NB30",
        'PORT': "1433",
        'OPTIONS': {
            'driver': 'ODBC Driver 13 for SQL Server',
        },
    },
}

I get this error:
django.db.utils.InterfaceError: ('28000', "[28000] [Microsoft][ODBC
Driver 13 for SQL Server][SQL Server]Login failed for user 'user'.
(18456) (SQLDriverConnect); [28000] [Microsoft][ODBC Driver 13 for SQL Ser
ver]Attributo di stringa di connessione non valido. (0); [28000]
[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for
user 'user'. (18456); [28000] [Microsoft][ODBC Driver 13 for SQL Server]A
ttributo di stringa di connessione non valido. (0)")

I tried to use the parameters above in a python script and works correctly.

What I can do to resolve this issue?

Thank you in advance


Maurizio Faccin

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f98b9f4d-d779-4778-6037-b8db16ee1595%40tiscali.it.

No comments:

Post a Comment