1

I am using django-mssql and SQL Server 2008, but I found that it always errors when I do some commands,for example:

python manage.py syncdb

the error is below:

raise OperationalError(e, "Error opening connection: " + connection_string) sqlserver_ado.dbapi.OperationalError: (com_error(-2147352567, '\xb7\xa2\xc9\xfa\ xd2\xe2\xcd\xe2\xa1\xa3', (0, u'Microsoft OLE DB Provider for SQL Server', u"\u7 528\u6237 'sa' \u767b\u5f55\u5931\u8d25\u3002", None, 0, -2147217843), None), 'E rror opening connection: PROVIDER=SQLOLEDB;DATA SOURCE=115.238.106.101,60433;Net work Library=DBMSSOCN;Initial Catalog=rvdb_2;UID=sa;PWD=xxx')

When I use Microsoft SQL Server Management studio client, I can successfully connect the database.

I got some infomation from: http://code.google.com/p/django-mssql/issues/detail?id=76 but I still tried I got wrong and I think the solution provided is wrong.

2
  • I reformatted as best I could but it looks like some of your error message got removed somehow, and that's the most important bit to have. It definitely is a connection error, but I don't know that we have enough information to give a useful response without the full error message. Commented Jun 9, 2010 at 2:31
  • I'm having a similar problem. However, I have managed to deduce it this way: If the SQL Server is on the development machine, it works just fine. When the SQL Server is on a remote machine, it doesn't work. Unfortunately, I have still not resolved the issue. :( Commented May 4, 2012 at 23:48

2 Answers 2

0

@Daniel DiPaolo Thant's the message I copied from consle. and I am sure that's all.... as I know this is because the newer mssql2008 is hardcoded.. you can see the url http://code.google.com/p/django-mssql/issues/detail?id=76 but I can't get it out...I think his code is wrong

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

3 Comments

It can't possibly be, part of the traceback is quite obviously cut off: ngo.db.backends.sqlserver_ado.dbapi.OperationalError: should be django.db.backends.sqlserver_ado.dbapi.OperationalError: - if you used the Windows console I'm guessing you missed the first three columns of copying.
this one.....and I have change password raise OperationalError(e, "Error opening connection: " + connection_string) sqlserver_ado.dbapi.OperationalError: (com_error(-2147352567, '\xb7\xa2\xc9\xfa\ xd2\xe2\xcd\xe2\xa1\xa3', (0, u'Microsoft OLE DB Provider for SQL Server', u"\u7 528\u6237 'sa' \u767b\u5f55\u5931\u8d25\u3002", None, 0, -2147217843), None), 'E rror opening connection: PROVIDER=SQLOLEDB;DATA SOURCE=115.238.106.101,60433;Net work Library=DBMSSOCN;Initial Catalog=rvdb_2;UID=sa;PWD=xxx')
this problem is obviously the code error.and I google tell me the newer mssql2008 is hardcode,can't change it...AND I use django1.1 to connect it
0

I had this same problem. I think the issue is that you don't have the database already created. The mssql backend doesn't seem to do this for you. As soon as I created the database and used the settings below everything worked!

DATABASES = {
    'default': {
        'NAME': 'testdb',
        'ENGINE': 'sqlserver_ado',
        'HOST': 'localhost',
        'USER': '',
        'PASSWORD': '',
        'OPTIONS' : {
            'provider': 'SQLNCLI10.1',
            'extra_params' : 'DataTypeCompatibility=80;MARS Connection=True'
        },
    }
}

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.