我一直在尝试将mssql数据库链接到Django。当我运行Django服务器时,出现以下错误。对于从Django发出的常规查询,它可以正常工作,但是Django甚至没有连接。奇怪的是,当我将驱动程序更改为“ SQL SERVER”而不是“ SQL Server ODBC驱动程序17”时。我没有错。但是,我需要“用于SQL Server的ODBC驱动程序17”,因为它具有许多我需要的功能。
export default {
name: 'ApplyTooltips',
data: () => ({
el: null,
}),
computed: {
text() {
return this.el ? this.el.innerHTML : ''
// return this.$slots.default[0].text
},
re() {
return /\[\[(.+?)\]\]/gi // captures [[words]]
},
parsed() {
return this.text.split(this.re) // every other value in this list will be a captured pattern
}
},
mounted() {
this.el = this.$el
// console.log(this.$slots.default[0].elm)
}
}
我的Django settings.py看起来像这样:
File "C:\ProgramData\Anaconda3\lib\site-packages\sql_server\pyodbc\base.py", line 307, in get_new_connection
timeout=timeout)
django.db.utils.InterfaceError: ('28000', "[28000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user 'EMEA\\kmoh'. (18456) (SQLDriverConnect); [28000] [Microsoft][ODBC Driver 17 for SQL Server]Invalid connection string attribute (0); [28000]
[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user 'EMEA\\kmoh'. (18456); [28000] [Microsoft][ODBC Driver 17 for SQL Server]Invalid connection string attribute (0)")