我在 Django 1.6.1 上使用 django-pyodbc
当我跑步时manage.py syncdb
,一切都很好。
当我从模型名称中读取数据时,我在 Django 中使用 2 个数据库设置从我的旧数据库中读取一些数据T_AllStation
:
all_t_station = T_AllStation.objects.using('SQL_Server').all()
引发错误:
DatabaseError at /company/get_station_info
('42S22', "[42S22] [Microsoft][ODBC SQL Server Driver][SQL Server]\xc1\xd0\xc3\xfb 'id' \xce\xde\xd0\xa7\xa1\xa3 (207) (SQLExecDirectW)")
Request Method: GET
Request URL: http://127.0.0.1:8000/company/get_station_info
Django Version: 1.6.1
Exception Type: DatabaseError
Exception Value:
('42S22', "[42S22] [Microsoft][ODBC SQL Server Driver][SQL Server]\xc1\xd0\xc3\xfb 'id' \xce\xde\xd0\xa7\xa1\xa3 (207) (SQLExecDirectW)")
Exception Location: E:\VirtualEnvs\EnvMonitor\lib\site-packages\django_pyodbc\base.py in execute, line 416
Python Executable: E:\VirtualEnvs\EnvMonitor\Scripts\python.exe
Python Version: 2.7.2
字符串\xc1\xd0\xc3\xfb 'id' \xce\xde\xd0\xa7\xa1\xa3 (207)
是什么意思?