Каждое приложение, которое я использую для инициации соединения ODBC, которое я создал с моей базой данных IBM Notes 9, приводит к ошибке во время соединения:
Driver’s SQLAllocHandle on SQL_HANDLE_DBC failed
Я искал в Интернете, пытаясь исправить это, и не смог найти ответ, который решает эту проблему на моей машине. Я могу открыть и получить доступ к базе данных Lotus Notes в программном обеспечении Notes 9. Я могу создать системный DSN ODBC и знаю, что он правильно подключается к серверу, потому что все доступные файлы .nsf
заполняются в раскрывающемся меню «База данных:» при настройке нового подключения ODBC. Я могу видеть свое имя пользователя, которое заполняется из моего файла идентификатора Notes. Проблема возникает, когда я использую что-то, чтобы инициировать соединение ODBC. Я пробовал Excel, QlikView, AQT, Teradata SQL Assistant, все с тем же результатом. Как только я выбираю соединение ODBC, которое я создал, и нажимаю «ОК» в каждом приложении, с которым я пытался это сделать, я встречаюсь с той же ошибкой, что и выше.
Я использовал Просмотрщик событий в соответствии с предложением в старом сообщении в Интернете и получил сообщение ниже:
Could not load NSQLE32.EXE. This file must exist in the same directory NSQL32.DLL and NSQLV32.DLL is in. It is possible NSQLE32.EXE could not be loaded because NotesSQL couldn’t locate a valid Notes/Domino installation (couldn’t find NNOTES.DLL) — this may be because user (MYUSERID) does not have the correct rights to the Notes/Domino directory. It could also be because NotesSQL can not find your Notes/Domino installation in the Registry. NotesSQL looks for the NNOTES.DLL file by looking in the path pointed to by the following Registry entries — HKEY_LOCAL_MACHINESoftwareLotusNotes{version}Path : HKEY_LOCAL_MACHINESoftwareLotusDomino{version}Path. If neither of these registry entries exist or they point to an invalid version of Notes/Domino NotesSQL will not work. To resolve — please re-install Notes/Domino.
Некоторые заметки (без каламбура) и то, что я сделал:
-
Проверено, что библиотеки DLL, упомянутые в Просмотрщик событий, существуют в соответствующих каталогах.
-
Запустите приложение
Nsql_ALM.exe
, чтобы настроить драйвер NotesSQL. -
Использовал 32-битный Администратор ODBC, потому что мой Notes 9 32-битный, а также драйвер. 64-битный драйвер даже не разрешал установку (попытался сделать это после того, как наткнулся на этот контрольно-пропускной пункт), но 32-битный установился успешно.
-
Изменена переменная системной среды для
Path
, чтобы включить истинное местоположениеnotes.ini
, которое находится в:C:UsersMYUSERIDAppDataLocalLotusNotesData
-
Изменена моя системная переменная среды для пути, чтобы включить расположение драйвера NotesSQL, который находится в:
C:NotesSQL
-
Изменил мой реестр, чтобы убедиться, что существуют соответствующие строки для ссылки на правильные файлы:
-
HKEY_CURRENT_USERSoftwareLotusNotesNotesIniPath
(доnotes.ini
) -
HKEY_LOCAL_MACHINESOFTWARELotusNotes9.0Path
(к приложению Примечания) -
HKEY_LOCAL_MACHINESOFTWARELotusNotes9.0DataPath
(доnotes.ini
) -
HKEY_LOCAL_MACHINESOFTWARELotusDomino9.0Path
(к приложению Примечания) -
HKEY_LOCAL_MACHINESOFTWARELotusDomino9.0DataPath
(доnotes.ini
)
-
-
Установите приложение
NSQLE32.exe
для работы в режиме совместимости со всеми остальными параметрами. -
Пробовал со всем запускать от имени администратора.
-
Удалил оба Примечания и NotesSQL и заново все переустановил.
-
Попытка вести журнал с помощью трассировки в администраторе ODBC, и он не создает файл журнала при попытке подключения. Однако он будет заполнен всеми системными подключениями ODBC, когда вызывающее приложение попытается найти существующие подключения для заполнения в раскрывающемся меню. Если я начну трассировку после того, как выпадающее меню будет заполнено, а затем попытаюсь установить соединение ODBC, даже несколько раз и с несколькими версиями, новый файл журнала никогда не будет создан.
Я не уверен, куда идти отсюда. У кого-нибудь была эта проблема, и есть ли что-то еще, что я могу сделать, чтобы исправить это?
Answer
SQLSTATE | Error | Can be returned from |
---|---|---|
01000 | General warning | All ODBC functions except:
SQLError |
01001 | Cursor operation conflict | SQLExecDirect SQLExecute SQLParamData SQLSetPos |
01002 | Disconnect error | SQLDisconnect |
01003 | NULL value eliminated in set function | SQLExecDirect SQLExecute SQLParamData |
01004 | String data, right-truncated | SQLBrowseConnect SQLBulkOperations SQLColAttribute SQLDataSources SQLDescribeCol SQLDriverConnect SQLDrivers SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetConnectAttr SQLGetCursorName SQLGetData SQLGetDescField SQLGetDescRec SQLGetEnvAttr SQLGetInfo SQLGetStmtAttr SQLNativeSql SQLParamData SQLPutData SQLSetCursorName |
01006 | Privilege not revoked | SQLExecDirect SQLExecute SQLParamData |
01007 | Privilege not granted | SQLExecDirect SQLExecute SQLParamData |
01S00 | Invalid connection string attribute | SQLBrowseConnect SQLDriverConnect |
01S01 | Error in row | SQLBulkOperations SQLExtendedFetch SQLSetPos |
01S02 | Option value changed | SQLBrowseConnect SQLConnect SQLDriverConnect SQLExecDirect SQLExecute SQLParamData SQLPrepare SQLSetConnectAttr SQLSetDescField SQLSetEnvAttr SQLSetStmtAttr |
01S06 | Attempt to fetch before the result set returned the first rowset | SQLExtendedFetch SQLFetchScroll |
01S07 | Fractional truncation | SQLBulkOperations SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLParamData SQLSetPos |
01S08 | Error saving File DSN | SQLDriverConnect |
01S09 | Invalid keyword | SQLDriverConnect |
07001 | Wrong number of parameters | SQLExecDirect SQLExecute |
07002 | COUNT field incorrect | SQLExecDirect SQLExecute SQLParamData |
07005 | Prepared statement not a cursor-specification | SQLColAttribute SQLDescribeCol |
07006 | Restricted data type attribute violation | SQLBindCol SQLBindParameter SQLBulkOperations SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLParamData SQLPutData SQLSetPos |
07009 | Invalid descriptor index | SQLBindCol SQLBindParameter SQLBulkOperations SQLColAttribute SQLDescribeCol SQLDescribeParam SQLFetch SQLFetchScroll SQLGetData SQLGetDescField SQLGetDescRec SQLParamData SQLSetDescField SQLSetDescRec SQLSetPos |
07S01 | Invalid use of default parameter | SQLExecDirect SQLExecute SQLParamData SQLPutData |
08001 | Client unable to establish connection | SQLBrowseConnect SQLConnect SQLDriverConnect |
08002 | Connection name in use | SQLBrowseConnect SQLConnect SQLDriverConnect SQLSetConnectAttr |
08003 | Connection does not exist | SQLAllocHandle SQLDisconnect SQLEndTran SQLGetConnectAttr SQLGetInfo SQLNativeSql SQLSetConnectAttr |
08004 | Server rejected the connection | SQLBrowseConnect SQLConnect SQLDriverConnect |
08007 | Connection failure during transaction | SQLEndTran |
08S01 | Communication link failure | SQLBrowseConnect SQLColumnPrivileges SQLColumns SQLConnect SQLCopyDesc SQLDescribeCol SQLDescribeParam SQLDriverConnect SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLForeignKeys SQLGetConnectAttr SQLGetData SQLGetDescField SQLGetDescRec SQLGetFunctions SQLGetInfo SQLGetTypeInfo SQLMoreResults SQLNativeSql SQLNumParams SQLNumResultCols SQLParamData SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLPutData SQLSetConnectAttr SQLSetDescField SQLSetDescRec SQLSetEnvAttr SQLSetStmtAttr SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
21S01 | Insert value list does not match column list | SQLExecDirect SQLPrepare |
21S02 | Degree of derived table does not match column list | SQLBulkOperations SQLExecDirect SQLExecute SQLParamData SQLPrepare SQLSetPos |
22001 | String data, right-truncated | SQLBulkOperations SQLExecDirect SQLExecute SQLFetch SQLFetchScroll SQLParamData SQLPutData SQLSetDescField SQLSetPos |
22002 | Indicator variable required but not supplied | SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLParamData |
22003 | Numeric value out of range | SQLBulkOperations SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLGetInfo SQLParamData SQLPutData SQLSetPos |
22007 | Invalid datetime format | SQLBulkOperations SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLParamData SQLPutData SQLSetPos |
22008 | Datetime field overflow | SQLBulkOperations SQLExecDirect SQLExecute SQLParamData SQLPutData |
22012 | Division by zero | SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLParamData SQLPutData |
22015 | Interval field overflow | SQLBulkOperations SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLParamData SQLPutData SQLSetPos |
22018 | Invalid character value for cast specification | SQLBulkOperations SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLParamData SQLPutData SQLSetPos |
22019 | Invalid escape character | SQLExecDirect SQLExecute SQLPrepare |
22025 | Invalid escape sequence | SQLExecDirect SQLExecute SQLPrepare |
22026 | String data, length mismatch | SQLParamData |
23000 | Integrity constraint violation | SQLBulkOperations SQLExecDirect SQLExecute SQLParamData SQLSetPos |
24000 | Invalid cursor state | SQLBulkOperations SQLCloseCursor SQLColumnPrivileges SQLColumns SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLForeignKeys SQLGetData SQLGetStmtAttr SQLGetTypeInfo SQLNativeSql SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLSetConnectAttr SQLSetCursorName SQLSetPos SQLSetStmtAttr SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
25000 | Invalid transaction state | SQLDisconnect |
25S01 | Transaction state | SQLEndTran |
25S02 | Transaction is still active | SQLEndTran |
25S03 | Transaction is rolled back | SQLEndTran |
28000 | Invalid authorization specification | SQLBrowseConnect SQLConnect SQLDriverConnect |
34000 | Invalid cursor name | SQLExecDirect SQLPrepare SQLSetCursorName |
3C000 | Duplicate cursor name | SQLSetCursorName |
3D000 | Invalid catalog name | SQLExecDirect SQLPrepare SQLSetConnectAttr |
3F000 | Invalid schema name | SQLExecDirect SQLPrepare |
40001 | Serialization failure | SQLBulkOperations SQLColumnPrivileges SQLColumns SQLEndTran SQLExecDirect SQLExecute SQLFetch SQLFetchScroll SQLForeignKeys SQLGetTypeInfo SQLMoreResults SQLParamData SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLSetPos SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
40002 | Integrity constraint violation | SQLEndTran |
40003 | Statement completion unknown | SQLBulkOperations SQLColumnPrivileges SQLColumns SQLExecDirect SQLExecute SQLFetch SQLFetchScroll SQLForeignKeys SQLGetTypeInfo SQLMoreResults SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLParamData SQLSetPos SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
42000 | Syntax error or access violation | SQLBulkOperations SQLExecDirect SQLExecute SQLParamData SQLPrepare SQLSetPos |
42S01 | Base table or view already exists | SQLExecDirect SQLPrepare |
42S02 | Base table or view not found | SQLExecDirect SQLPrepare |
42S11 | Index already exists | SQLExecDirect SQLPrepare |
42S12 | Index not found | SQLExecDirect SQLPrepare |
42S21 | Column already exists | SQLExecDirect SQLPrepare |
42S22 | Column not found | SQLExecDirect SQLPrepare |
44000 | WITH CHECK OPTION violation | SQLBulkOperations SQLExecDirect SQLExecute SQLParamData SQLSetPos |
HY000 | General error | All ODBC functions except:
SQLError |
HY001 | Memory allocation error | All ODBC functions except:
SQLError |
HY003 | Invalid application buffer type | SQLBindCol SQLBindParameter SQLGetData |
HY004 | Invalid SQL data type | SQLBindParameter SQLGetTypeInfo |
HY007 | Associated statement is not prepared | SQLCopyDesc SQLGetDescField SQLGetDescRec |
HY008 | Operation canceled | All ODBC functions that can be processed asynchronously:
SQLBulkOperations |
HY009 | Invalid use of null pointer | SQLAllocHandle SQLBindParameter SQLBulkOperations SQLColumnPrivileges SQLColumns SQLExecDirect SQLForeignKeys SQLGetCursorName SQLGetData SQLGetFunctions SQLNativeSql SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLPutData SQLSetConnectAttr SQLSetCursorName SQLSetEnvAttr SQLSetStmtAttr SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
HY010 | Function sequence error | SQLAllocHandle SQLBindCol SQLBindParameter SQLBulkOperations SQLCloseCursor SQLColAttribute SQLColumnPrivileges SQLColumns SQLCopyDesc SQLDescribeCol SQLDescribeParam SQLDisconnect SQLEndTran SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLForeignKeys SQLFreeHandle SQLFreeStmt SQLGetConnectAttr SQLGetCursorName SQLGetData SQLGetDescField SQLGetDescRec SQLGetFunctions SQLGetStmtAttr SQLGetTypeInfo SQLMoreResults SQLNumParams SQLNumResultCols SQLParamData SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLPutData SQLRowCount SQLSetConnectAttr SQLSetCursorName SQLSetDescField SQLSetEnvAttr SQLSetDescRec SQLSetPos SQLSetStmtAttr SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
HY011 | Attribute cannot be set now | SQLBulkOperations SQLParamData SQLSetConnectAttr SQLSetPos SQLSetStmtAttr |
HY012 | Invalid transaction operation code | SQLEndTran |
HY013 | Memory management error | All ODBC functions except:
SQLGetDiagField |
HY014 | Limit on the number of handles exceeded | SQLAllocHandle |
HY015 | No cursor name available | SQLGetCursorName |
HY016 | Cannot modify an implementation row descriptor | SQLCopyDesc SQLSetDescField SQLSetDescRec |
HY017 | Invalid use of an automatically allocated descriptor handle | SQLFreeHandle SQLSetStmtAttr |
HY018 | Server declined cancel request | SQLCancel |
HY019 | Non-character and non-binary data sent in pieces | SQLPutData |
HY020 | Attempt to concatenate a null value | SQLPutData |
HY021 | Inconsistent descriptor information | SQLBindParameter SQLCopyDesc SQLGetDescField SQLSetDescField SQLSetDescRec |
HY024 | Invalid attribute value | SQLSetConnectAttr SQLSetEnvAttr SQLSetStmtAttr |
HY090 | Invalid string or buffer length | SQLBindCol SQLBindParameter SQLBrowseConnect SQLBulkOperations SQLColAttribute SQLColumnPrivileges SQLColumns SQLConnect SQLDataSources SQLDescribeCol SQLDriverConnect SQLDrivers SQLExecDirect SQLExecute SQLFetch SQLFetchScroll SQLForeignKeys SQLGetConnectAttr SQLGetCursorName SQLGetData SQLGetDescField SQLGetInfo SQLGetStmtAttr SQLNativeSql SQLParamData SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLPutData SQLSetConnectAttr SQLSetCursorName SQLSetDescField SQLSetDescRec SQLSetEnvAttr SQLSetStmtAttr SQLSetPos SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
HY091 | Invalid descriptor field identifier | SQLColAttribute SQLGetDescField SQLSetDescField |
HY092 | Invalid attribute/option identifier | SQLAllocHandle SQLBulkOperations SQLCopyDesc SQLDriverConnect SQLEndTran SQLFreeStmt SQLGetConnectAttr SQLGetEnvAttr SQLGetStmtAttr SQLParamData SQLSetConnectAttr SQLSetDescField SQLSetEnvAttr SQLSetPos SQLSetStmtAttr |
HY095 | Function type out of range | SQLGetFunctions |
HY096 | Invalid information type | SQLGetInfo |
HY097 | Column type out of range | SQLSpecialColumns |
HY098 | Scope type out of range | SQLSpecialColumns |
HY099 | Nullable type out of range | SQLSpecialColumns |
HY100 | Uniqueness option type out of range | SQLStatistics |
HY101 | Accuracy option type out of range | SQLStatistics |
HY103 | Invalid retrieval code | SQLDataSources SQLDrivers |
HY104 | Invalid precision or scale value | SQLBindParameter |
HY105 | Invalid parameter type | SQLBindParameter SQLExecDirect SQLExecute SQLParamData SQLSetDescField |
HY106 | Fetch type out of range | SQLExtendedFetch SQLFetchScroll |
HY107 | Row value out of range | SQLExtendedFetch SQLFetch SQLFetchScroll SQLSetPos |
HY109 | Invalid cursor position | SQLExecDirect SQLExecute SQLGetData SQLGetStmtAttr SQLNativeSql SQLParamData SQLSetPos |
HY110 | Invalid driver completion | SQLDriverConnect |
HY111 | Invalid bookmark value | SQLExtendedFetch SQLFetchScroll |
HYC00 | Optional feature not implemented | SQLBindCol SQLBindParameter SQLBulkOperations SQLColAttribute SQLColumnPrivileges SQLColumns SQLDriverConnect SQLEndTran SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLForeignKeys SQLGetConnectAttr SQLGetData SQLGetEnvAttr SQLGetInfo SQLGetStmtAttr SQLGetTypeInfo SQLParamData SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLSetConnectAttr SQLSetEnvAttr SQLSetPos SQLSetStmtAttr SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
HYT00 | Timeout expired | SQLBrowseConnect SQLBulkOperations SQLColumnPrivileges SQLColumns SQLConnect SQLDriverConnect SQLExecDirect SQLExecute SQLExtendedFetch SQLForeignKeys SQLGetTypeInfo SQLParamData SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLSetPos SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
HYT01 | Connection timeout expired | All ODBC functions except:
SQLDrivers |
IM001 | Driver does not support this function | All ODBC functions except:
SQLAllocHandle |
IM002 | Data source name not found and no default driver specified | SQLBrowseConnect SQLConnect SQLDriverConnect |
IM003 | Specified driver could not be loaded | SQLBrowseConnect SQLConnect SQLDriverConnect |
IM004 | Driver’s SQLAllocHandle on SQL_HANDLE_ENV failed | SQLBrowseConnect SQLConnect SQLDriverConnect |
IM005 | Driver’s SQLAllocHandle on SQL_HANDLE_DBC failed | SQLBrowseConnect SQLConnect SQLDriverConnect |
IM006 | Driver’s SQLSetConnectAttr failed | SQLBrowseConnect SQLConnect SQLDriverConnect |
IM007 | No data source or driver specified; dialog prohibited | SQLDriverConnect |
IM008 | Dialog failed | SQLDriverConnect |
IM009 | Unable to load translation DLL | SQLBrowseConnect SQLConnect SQLDriverConnect SQLSetConnectAttr |
IM010 | Data source name too long | SQLBrowseConnect SQLConnect SQLDriverConnect |
IM011 | Driver name too long | SQLBrowseConnect SQLDriverConnect |
IM012 | DRIVER keyword syntax error | SQLBrowseConnect SQLDriverConnect |
IM013 | Trace file error | All ODBC functions |
IM014 | Invalid name of File DSN | SQLDriverConnect |
IM015 | Corrupt file data source | SQLDriverConnect |
Hi MLPradeep ,
From you post, we figured out that you have found one job is causing this issue and Agent crash is happening same time that job is scheduled. Since then, would you
please kindly let us know what job it is?
According to the error message below, it looks like there is some problem in the driver installation (resource?), the driver seemed to load fine, but it failed in
the very first ODBC call from the ODBC admin tool — SQLAllocEnv.
2010-09-05 06:21:47 — ! [364] The Messenger service has not been started — NetSend notifications will not be sent
2010-09-05 06:21:47 — ? [129] SQLSERVERAGENT starting under Windows NT service control
2010-09-05 06:21:47 — + [260] Unable to start mail session (reason: No mail profile defined)
2010-09-05 06:21:47 — + [396] An idle CPU condition has not been defined — OnIdle job schedules will have no effect
2010-09-08 00:08:45 — ? [130] SQLSERVERAGENT stopping because of Windows shutdown…
2010-09-08 00:08:46 — ! [165] ODBC Error: 0, Driver’s SQLAllocHandle on SQL_HANDLE_ENV failed [SQLSTATE IM004]
2010-09-08 00:08:46 — ! [382] Logon to server ‘(local)’ failed (SaveAllSchedules)
2010-09-08 00:08:49 — ! [165] ODBC Error: 0, Driver’s SQLAllocHandle on SQL_HANDLE_ENV failed [SQLSTATE IM004]
2010-09-08 00:08:49 — ! [382] Logon to server ‘(local)’ failed (DisableAgentXPs)
2010-09-08 00:08:50 — ? [098] SQLServerAgent terminated (normally)
For further investigation, would you please provide the following error information:
1. SQL MPS Reports
2. Dump File generated in the LOG Directory, to generate a Full Dump in the event of SQL Server Agent stopping unexpectedly, we would
need to follow the below steps:
1> Please navigate to the registry key:HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL Server<InstanceID>SQLServerAgent
2> Create a REG_DWORD. Name it “FullDump” and set it to 1.
3. SQL Server Agent Logs from the Log Directory.
4. Windows Event log
You can send the logs to sqltnsp AT Microsoft.com (Please replace AT with @) with this format:
#Sample
Subject: MSDN/TechNet forum question: <Thread Title>
Attachments: <files>
Hi Grace,
ThreadURL:<URL>
<Additional information>
#End
For more information about how to View and Read SQL Server Setup Log Files, please see
http://msdn.microsoft.com/en-us/library/ms143702.aspx
Information about the SQL Server edition of the MPS Reporting tool:
http://support.microsoft.com/kb/883724
If there are more questions, please feel free to ask.
Thanks,
Grace
Please kindly mark the answer if it is a workaround. Thanks a lot *^_^*
-
Proposed as answer by
Thursday, September 30, 2010 2:44 AM
-
Marked as answer by
Tom Li — MSFT
Sunday, October 10, 2010 8:26 AM
title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | helpviewer_keywords | |||
---|---|---|---|---|---|---|---|---|---|---|---|
Appendix A: ODBC Error Codes |
Appendix A: ODBC Error Codes |
David-Engel |
v-davidengel |
01/19/2017 |
sql |
connectivity |
reference |
|
This topic discusses SQLSTATE values for ODBC 3.x. For more information on ODBC 3.x SQLSTATE values, see SQLSTATE Mappings.
SQLGetDiagRec or SQLGetDiagField returns SQLSTATE values as defined by Open Group Data Management: Structured Query Language (SQL), Version 2 (March 1995). SQLSTATE values are strings that contain five characters. The following table lists SQLSTATE values that a driver can return for SQLGetDiagRec.
The character string value returned for an SQLSTATE consists of a two-character class value followed by a three-character subclass value. A class value of «01» indicates a warning and is accompanied by a return code of SQL_SUCCESS_WITH_INFO. Class values other than «01,» except for the class «IM,» indicate an error and are accompanied by a return value of SQL_ERROR. The class «IM» is specific to warnings and errors that derive from the implementation of ODBC itself. The subclass value «000» in any class indicates that there is no subclass for that SQLSTATE. The assignment of class and subclass values is defined by SQL-92.
[!NOTE]
Although successful execution of a function is normally indicated by a return value of SQL_SUCCESS, the SQLSTATE 00000 also indicates success.
SQLSTATE | Error | Can be returned from |
---|---|---|
01000 | General warning | All ODBC functions except:
SQLError SQLGetDiagField SQLGetDiagRec |
01001 | Cursor operation conflict | SQLExecDirect
SQLExecute SQLParamData SQLSetPos |
01002 | Disconnect error | SQLDisconnect |
01003 | NULL value eliminated in set function | SQLExecDirect
SQLExecute SQLParamData |
01004 | String data, right-truncated | SQLBrowseConnect
SQLBulkOperations SQLColAttribute SQLDataSources SQLDescribeCol SQLDriverConnect SQLDrivers SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetConnectAttr SQLGetCursorName SQLGetData SQLGetDescField SQLGetDescRec SQLGetEnvAttr SQLGetInfo SQLGetStmtAttr SQLNative Sql SQLParamData SQLPutData SQLSetCursorName |
01006 | Privilege not revoked | SQLExecDirect
SQLExecute SQLParamData |
01007 | Privilege not granted | SQLExecDirect
SQLExecute SQLParamData |
01S00 | Invalid connection string attribute | SQLBrowseConnect
SQLDriverConnec |
01S01 | Error in row | SQLBulkOperations
SQLExtendedFetch SQLSetPos |
01S02 | Option value changed | SQLBrowseConnect
SQLConnect SQLDriverConnect SQLExecDirect SQLExecute SQLParamData SQLPrepare SQLSetConnectAttr SQLSetDescField SQLSetEnvAttr SQLSetStmtAttr |
01S06 | Attempt to fetch before the result set returned the first rowset | SQLExtendedFetch
SQLFetchScroll |
01S07 | Fractional truncation | SQLBulkOperations
SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLParamData SQLSetPos |
01S08 | Error saving File DSN | SQLDriverConnect |
01S09 | Invalid keyword | SQLDriverConnect |
07001 | Wrong number of parameters | SQLExecDirect
SQLExecute |
07002 | COUNT field incorrect | SQLExecDirect
SQLExecute SQLParamData |
07005 | Prepared statement not a cursor-specification | SQLColAttribute
SQLDescribeCol |
07006 | Restricted data type attribute violation | SQLBindCol
SQLBindParameter SQLBulkOperations SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLParamData SQLPutData SQLSetPos |
07009 | Invalid descriptor index | SQLBindCol
SQLBindParameter SQLBulkOperations SQLColAttribute SQLDescribeCol SQLDescribeParam SQLFetch SQLFetchScroll SQLGetData SQLGetDescField SQLGetDescRec SQLParamData SQLSetDescField SQLSetDescRecSQLSetPos |
07S01 | Invalid use of default parameter | SQLExecDirect
SQLExecute SQLParamData SQLPutData |
08001 | Client unable to establish connection | SQLBrowseConnect
SQLConnect SQLDriverConnect |
08002 | Connection name in use | SQLBrowseConnect
SQLConnect SQLDriverConnect SQLSetConnectAttr |
08003 | Connection not open | SQLAllocHandle
SQLDisconnect SQLEndTran SQLGetConnectAttr SQLGetInfo SQLNativeSql SQLSetConnectAttr |
08004 | Server rejected the connection | SQLBrowseConnect
SQLConnect SQLDriverConnect |
08007 | Connection failure during transaction | SQLEndTran |
08S01 | Communication link failure | SQLBrowseConnect
SQLColumnPrivileges SQLColumns SQLConnect SQLCopyDesc SQLDescribeCol SQLDescribeParam SQLDriverConnect SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLForeignKeys SQLGetConnectAttr SQLGetData SQLGetDescField SQLGetDescRec SQLGetFunctions SQLGetInfo SQLGetTypeInfo SQLMoreResults SQLNativeSql SQLNumParams SQLNumResultCols SQLParamData SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLPutData SQLSetConnectAttr SQLSetDescField SQLSetDescRec SQLSetEnvAttr SQLSetStmtAttr SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
21S01 | Insert value list does not match column list | SQLExecDirect
SQLPrepare |
21S02 | Degree of derived table does not match column list | SQLBulkOperations
SQLExecDirect SQLExecute SQLParamData SQLPrepare SQLSetPos |
22001 | String data, right-truncated | SQLBulkOperations
SQLExecDirect SQLExecute SQLFetch SQLFetchScroll SQLParamData SQLPutData SQLSetDescField SQLSetPos |
22002 | Indicator variable required but not supplied | SQLExecDirect
SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLParamData |
22003 | Numeric value out of range | SQLBulkOperations
SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLGetInfo SQLParamData SQLPutData SQLSetPos |
22007 | Invalid datetime format | SQLBulkOperations
SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLParamData SQLPutData SQLSetPos |
22008 | Datetime field overflow | SQLBulkOperations
SQLExecDirect QLParamData SQLPutData |
22012 | Division by zero | SQLExecDirect
SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLPutData |
22015 | Interval field overflow | SQLBulkOperations
SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLParamData SQLPutData SQLSetPos |
22018 | Invalid character value for cast specification | SQLBulkOperations
SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLGetData SQLParamData SQLPutData SQLSetPos |
22019 | Invalid escape character | SQLExecDirect
SQLExecute SQLPrepare |
22025 | Invalid escape sequence | SQLExecDirect
SQLExecute SQLPrepare |
22026 | String data, length mismatch | SQLParamData |
23000 | Integrity constraint violation | SQLBulkOperations
SQLExecDirect SQLExecute SQLParamData SQLSetPos |
24000 | Invalid cursor state | SQLBulkOperations
SQLCloseCursor SQLColumnPrivileges SQLColumns SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLForeignKeys SQLGetData SQLGetStmtAttr SQLGetTypeInfo SQLNativeSql SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLSetConnectAttr SQLSetCursorName SQLSetPos SQLSetStmtAttr SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
25000 | Invalid transaction state | SQLDisconnect |
25S01 | Transaction state | SQLEndTran |
25S02 | Transaction is still active | SQLEndTran |
25S03 | Transaction is rolled back | SQLEndTran |
28000 | Invalid authorization specification | SQLBrowseConnect
SQLConnect SQLDriverConnect |
34000 | Invalid cursor name | SQLExecDirect
SQLPrepare SQLSetCursorName |
3C000 | Duplicate cursor name | SQLSetCursorName |
3D000 | Invalid catalog name | SQLExecDirect
SQLPrepare SQLSetConnectAttr |
3F000 | Invalid schema name | SQLExecDirect
SQLPrepare |
40001 | Serialization failure | SQLBulkOperations
SQLColumnPrivileges SQLColumns SQLEndTran SQLExecDirect SQLExecute SQLFetch SQLFetchScroll SQLForeignKeys SQLGetTypeInfo SQLMoreResults SQLParamData SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLSetPos SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
40002 | Integrity constraint violation | SQLEndTran |
40003 | Statement completion unknown | SQLBulkOperations
SQLColumnPrivileges SQLColumns SQLExecDirect SQLExecute SQLFetch SQLFetchScroll SQLForeignKeys SQLGetTypeInfo SQLMoreResults SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLParamData SQLSetPos SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
42000 | Syntax error or access violation | SQLBulkOperations
SQLExecDirect SQLExecute SQLParamData SQLPrepare SQLSetPos |
42S01 | Base table or view already exists | SQLExecDirect
SQLPrepare |
42S02 | Base table or view not found | SQLExecDirect
SQLPrepare |
42S11 | Index already exists | SQLExecDirect
SQLPrepare |
42S12 | Index not found | SQLExecDirect
SQLPrepare |
42S21 | Column already exists | SQLExecDirect
SQLPrepare |
42S22 | Column not found | SQLExecDirect
SQLPrepare |
44000 | WITH CHECK OPTION violation | SQLBulkOperations
SQLExecDirect SQLExecute SQLParamData SQLSetPos |
HY000 | General error | All ODBC functions except:
SQLError SQLGetDiagField SQLGetDiagRec |
HY001 | Memory allocation error | All ODBC functions except:
SQLError SQLGetDiagField SQLGetDiagRec |
HY003 | Invalid application buffer type | SQLBindCol
SQLBindParameter SQLGetData |
HY004 | Invalid SQL data type | SQLBindParameter
SQLGetTypeInfo |
HY007 | Associated statement is not prepared | SQLCopyDesc
SQLGetDescField SQLGetDescRec |
HY008 | Operation canceled | All ODBC functions that can be processed asynchronously:
SQLBrowseConnect SQLBulkOperations SQLColAttribute SQLColumnPrivileges SQLColumns SQLConnect SQLDescribeCol SQLDescribeParam SQLDisconnect SQLDriverConnect SQLEndTran SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLForeignKeys SQLGetData SQLGetTypeInfo SQLMoreResults SQLNumParams SQLNumResultCols SQLParamData SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLPutData SQLSetConnectAttr SQLSetPos SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
HY009 | Invalid use of null pointer | SQLAllocHandle
SQLBindParameter SQLBulkOperations SQLColumnPrivileges SQLColumns SQLExecDirect SQLForeignKeys SQLGetCursorName SQLGetData SQLGetFunctions SQLNativeSql SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLPutData SQLSetConnectAttr SQLSetCursorName SQLSetEnvAttr SQLSetStmtAttr SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
HY010 | Function sequence error | SQLAllocHandle
SQLBindCol SQLBindParameter SQLBulkOperations SQLCloseCursor SQLColAttribute SQLColumnPrivileges SQLColumns SQLCopyDesc SQLDescribeCol SQLDescribeParam SQLDisconnect SQLEndTran SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLForeignKeys SQLFreeHandle SQLFreeStmt SQLGetConnectAttr SQLGetCursorName SQLGetData SQLGetDescField SQLGetDescRec SQLGetFunctions SQLGetStmtAttr SQLGetTypeInfo SQLMoreResults SQLNumParams SQLNumResultCols SQLParamData SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLPutData SQLRowCount SQLSetConnectAttr SQLSetCursorName SQLSetDescField SQLSetEnvAttr SQLSetDescRec SQLSetPos SQLSetStmtAttr SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
HY011 | Attribute cannot be set now | SQLBulkOperations
SQLParamData QLSetPos SQLSetStmtAttr |
HY012 | Invalid transaction operation code | SQLEndTran |
HY013 | Memory management error | All ODBC functions except:
SQLGetDiagField SQLGetDiagRec |
HY014 | Limit on the number of handles exceeded | SQLAllocHandle |
HY015 | No cursor name available | SQLGetCursorName |
HY016 | Cannot modify an implementation row descriptor | SQLCopyDesc
SQLSetDescField SQLSetDescRec |
HY017 | Invalid use of an automatically allocated descriptor handle | SQLFreeHandle
SQLSetStmtAttr |
HY018 | Server declined cancel request | SQLCancel |
HY019 | Non-character and non-binary data sent in pieces | SQLPutData |
HY020 | Attempt to concatenate a null value | SQLPutData |
HY021 | Inconsistent descriptor information | SQLBindParameter
SQLCopyDesc SQLGetDescField SQLSetDescField SQLSetDescRec |
HY024 | Invalid attribute value | SQLSetConnectAttr
SQLSetEnvAttr SQLSetStmtAttr |
HY090 | Invalid string or buffer length | SQLBindCol
SQLBindParameter SQLBrowseConnect SQLBulkOperations SQLColAttribute SQLColumnPrivileges SQLColumns SQLConnect SQLDataSources SQLDescribeCol SQLDriverConnect SQLDrivers SQLExecDirect SQLExecute SQLFetch SQLFetchScroll SQLForeignKeys SQLGetConnectAttr SQLGetCursorName SQLGetData SQLGetDescField SQLGetInfo SQLGetStmtAttr SQLNativeSql SQLParamData SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLPutData SQLSetConnectAttr SQLSetCursorName SQLSetDescField SQLSetDescRec SQLSetEnvAttr SQLSetStmtAttr SQLSetPos SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
HY091 | Invalid descriptor field identifier | SQLColAttribute
SQLGetDescField SQLSetDescField |
HY092 | Invalid attribute/option identifier | SQLAllocHandle
QLBulkOperations SQLCopyDesc SQLDriverConnect SQLEndTran SQLFreeStmt SQLGetConnectAttr SQLGetEnvAttr QLParamData SQLSetConnectAttr SQLSetDescField SQLSetEnvAttr SQLSetPos SQLSetStmtAttr |
HY095 | Function type out of range | SQLGetFunctions |
HY096 | Invalid information type | SQLGetInfo |
HY097 | Column type out of range | SQLSpecialColumns |
HY098 | Scope type out of range | SQLSpecialColumns |
HY099 | Nullable type out of range | SQLSpecialColumns |
HY100 | Uniqueness option type out of range | SQLStatistics |
HY101 | Accuracy option type out of range | SQLStatistics |
HY103 | Invalid retrieval code | SQLDataSources
SQLDrivers |
HY104 | Invalid precision or scale value | SQLBindParameter |
HY105 | Invalid parameter type | SQLBindParameter
SQLExecDirect SQLExecute SQLParamData SQLSetDescField |
HY106 | Fetch type out of range | SQLExtendedFetch
SQLFetchScroll |
HY107 | Row value out of range | SQLExtendedFetch
SQLFetch SQLFetchScroll SQLSetPos |
HY109 | Invalid cursor position | SQLExecDirect
SQLExecute SQLGetData SQLGetStmtAttr SQLNativeSql SQLParamData SQLSetPos |
HY110 | Invalid driver completion | SQLDriverConnect |
HY111 | Invalid bookmark value | SQLExtendedFetch
SQLFetchScroll |
HYC00 | Optional feature not implemented | SQLBindCol
SQLBindParameter SQLBulkOperations SQLColAttribute SQLColumnPrivileges SQLColumns SQLDriverConnect SQLEndTran SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLForeignKeys SQLGetConnectAttr SQLGetData SQLGetEnvAttr SQLGetInfo SQLGetStmtAttr SQLGetTypeInfo SQLParamData SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLSetConnectAttr SQLSetEnvAttr SQLSetPos SQLSetStmtAttr SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
HYT00 | Timeout expired | SQLBrowseConnect
SQLBulkOperations SQLColumnPrivileges SQLColumns SQLConnect SQLDriverConnect SQLExecDirect SQLExecute SQLExtendedFetch SQLForeignKeys SQLGetTypeInfo SQLParamData SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLSetPos SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables |
HYT01 | Connection timeout expired | All ODBC functions except:
SQLDrivers SQLDataSources SQLGetEnvAttr SQLSetEnvAttr |
IM001 | Driver does not support this function | All ODBC functions except:
SQLAllocHandle SQLDataSources SQLDrivers SQLFreeHandle SQLGetFunctions |
IM002 | Data source name not found and no default driver specified | SQLBrowseConnect
SQLConnect SQLDriverConnect |
IM003 | Specified driver could not be loaded | SQLBrowseConnect
SQLConnect SQLDriverConnect |
IM004 | Driver’s SQLAllocHandle on SQL_HANDLE_ENV failed | SQLBrowseConnect
SQLConnect SQLDriverConnect |
IM005 | Driver’s SQLAllocHandle on SQL_HANDLE_DBC failed | SQLBrowseConnect
SQLConnect SQLDriverConnect |
IM006 | Driver’s SQLSetConnectAttr failed | SQLBrowseConnect
SQLConnect SQLDriverConnect |
IM007 | No data source or driver specified; dialog prohibited | SQLDriverConnect |
IM008 | Dialog failed | SQLDriverConnect |
IM009 | Unable to load translation DLL | SQLBrowseConnect
SQLConnect SQLDriverConnect SQLSetConnectAttr |
IM010 | Data source name too long | SQLBrowseConnect
SQLConnect SQLDriverConnect |
IM011 | Driver name too long | SQLBrowseConnect
SQLDriverConnect |
IM012 | DRIVER keyword syntax error | SQLBrowseConnect
SQLDriverConnect |
IM013 | Trace file error | All ODBC functions. |
IM014 | Invalid name of File DSN | SQLDriverConnect |
IM015 | Corrupt file data source | SQLDriverConnect |
ODBC Error Messages
SQLERROR returns SQLSTATE values as defined by the X/Open and SQL Access Group SQL CAE specification (1992). SQLSTATE values are strings that contain five characters. The following table lists SQLSTATE values that a driver can return for SQLError.
The character string value returned for SQLSTATE consists of a two-character class value followed by a three-character subclass value. A class value of 01 indicates a warning and is accompanied by a return code of SQL_SUCCESS_WITH_INFO. Class values other than 01, except for the class IM, indicate an error and are accompanied by a return code of SQL_ERROR. The class IM is specific to warnings and errors that derive from the implementation of ODBC. The subclass value 000 in any class is for implementation defined conditions within the given class. The assignment of class and subclass values is defined by SQL-92.
Note Although successful execution of a function is indicated typically by a return value of SQL_SUCCESS, the SQLSTATE 00000 also indicates success.
SQLSTATE | ODBC API (Driver Manager) error |
---|---|
00000 | Success |
01000 | General warning |
01002 | Disconnect error |
01004 | Data truncated |
01006 | Privilege not revoked |
01S00 | Invalid connection string attribute |
01S01 | Error in row |
01S02 | Option value changed |
01S03 | No rows updated or deleted |
01S04 | More than one row updated or deleted |
01S05 | Cancel treated as FreeStmt/Close |
01S06 | Attempt to fetch before the result returned the first rowset |
07001 | Wrong number of parameters |
07006 | Restricted data type attribute violation |
07S01 | Invalid use of default paramater |
08001 | Unable to connect to data source |
08002 | Connection in use |
08003 | Connection not open |
08004 | Data source rejected establishment of connection |
08007 | Connection failure during transaction |
08S01 | Communication link failure |
21S01 | Insert value list does not match column list |
21S02 | Degree of derived table does not match column list |
22001 | String data right truncation |
22002 | Indicator variable required but not supplied |
22003 | Numeric value out of range |
22005 | Error in assignment |
22008 | Datetime field overflow |
22012 | Division by zero |
22026 | String data, length mismatch |
23000 | Integrity constraint violation |
24000* | Invalid cursor state |
25000 | Invalid transaction state |
28000 | Invalid authorization specification |
34000 | Invalid cursor name |
37000 | Syntax error or access violation |
3C000 | Duplicate cursor name |
40001 | Serialization failure |
42000 | Syntax error or access violation |
70100 | Operation aborted |
IM001 | Driver does not support this function |
IM002 | Data source name not found and no default driver specified |
IM003 | Specified driver could not be loaded |
IM004 | Driver’s SQLAllocEnv failed |
IM005 | Driver’s SQLAllocConnect failed |
IM006 | Driver’s SQLSetConnectOption failed |
IM007 | No data source or driver specified; dialog prohibited |
IM008 | Dialog failed |
IM009 | Unable to load translation DLL |
IM010 | Data source name too long |
IM011 | Driver name too long |
IM012 | DRIVER keyword syntax error |
IM013 | Trace file error |
S0001 | Base table or view already exists |
S0002 | Base table not found |
S0011 | Index already exists |
S0012 | Index not found |
S0021 | Column already exists |
S0022 | Column not found |
S0023 | No default for column |
S1000 | General error |
S1001 | Memory allocation failure |
S1002 | Invalid column number |
S1003 | Program type out of range |
S1004 | SQL data type out of range |
S1008 | Operation canceled |
S1009 | Invalid argument value |
S1010 | Function sequence error |
S1011 | Operation invalid at this time |
S1012 | Invalid transaction operation code specified |
S1015 | No cursor name available |
S1090 | Invalid string or buffer length |
S1091 | Descriptor type out of range |
S1092 | Option type out of range |
S1093 | Invalid parameter number |
S1094 | Invalid scale value |
S1095 | Function type out of range |
S1096 | Information type out of range |
S1097 | Column type out of range |
S1098 | Scope type out of range |
S1099 | Nullable type out of range |
S1100 | Uniqueness option type out of range |
S1101 | Accuracy option type out of range |
S1103 | Direction option out of range |
S1104 | Invalid precision value |
S1105 | Invalid parameter type |
S1106 | Fetch type out of range |
S1107 | Row value out of range |
S1108 | Concurrency option out of range |
S1109 | Invalid cursor position |
S1110 | Invalid driver completion |
S1111 | Invalid bookmark value |
S1C00 | Driver not capable |
S1DE0 | No data at execution values pending |
S1T00 | Timeout expired |
* In SQL Server Enterprise Manager, you may receive the «Invalid cursor state» error message when Microsoft® SQL Server™ runs out of resources while attempting to save selected tables or a database diagram. This error is returned because of insufficient space in your database or transaction log to complete the save process. To correct this problem, check to see if the database or the transaction log is full. If so, increase the size of the database to accommodate the change. Check other system resources or contact your system administrator.
In addition to the standard ODBC error messages located in your ODBC programmer’s reference documentation, the SQL Server ODBC driver can return error messages for certain SQLSTATE values, as shown in this table.
SQLSTATE | SQL SERVER DRIVER ERROR | Description |
---|---|---|
01000 | %ld rows sent to SQL Server. Total sent: %ld. | A batch size of rows have been sent to SQL Server using the BCP API. |
01000 | %ld rows successfully bulk-copied to host-file. Total received: %ld. | A batch size of rows have been written to the host file using the BCP API. |
01000 | Access to database configured in the DSN has been denied. Default used. | Either the database does not exist or the user does not have permission to access the database. The default database configured for the login ID was used. |
01000 | An error has occurred during an attempt to access the log file, logging disabled. | The log file for driver statistics or long-running queries could not be used. The logging of driver statistics or long-running queries has been disabled. |
01000 | Connected to backup server. | The SQL Server primary server was not available, so the connection was made to the fallback server. |
01000 | Language configured in the DSN is not supported. Default used. | Either the language name is invalid or the language is not installed on the server. The default language configured for the login ID was used. |
01000 | Null bit data forced to zero. | A bit field containing a NULL is being loaded to a server that does not support NULL bit data. The field was set to zero. |
01000 | Procedure executed with ‘EXEC’. No output parameters returned. | The procedure could not be executed as an RPC and output parameters were specified. Because the procedure had to be executed with EXEC, no output parameters will be stored. |
01000 | SQL Debugging disabled. | SQL Debugging could not be enabled, probably because the SQL Server is not configured for SQL debugging. |
01000 | The ODBC catalog stored procedures installed on server %s are version %s; version %02d.%02d.%4.4d or later is required to ensure proper operation. Please contact your system administrator. | Install the ODBC catalog stored procedures by executing MsqqlInstallInstcat.sql. |
01000 | Zero length data forced to length 1. | A zero-length binary or character field is being loaded, but zero-length data is not supported. The field was forced to a 1 byte blank or binary zero. |
01S02 | Cursor concurrency changed. | The application requested a concurrency that could not be honored because of the type of request or query. A different concurrency was used instead. |
01S02 | Cursor type changed. | The application requested a cursor type that could not be honored because of the type of request or query. A different cursor type was used instead. |
01S02 | Packet size change not honored by server, server size used. | The application requested a nondefault packet size that could not be supported by SQL Server. The server default size was used instead. |
01S02 | Packet size changed. | The application requested a nondefault packet size that was outside of the limits of allowable size. Either the smallest or largest packet size was used instead, depending if the requested size was too small or too large. |
01S02 | Login timeout changed. | The application requested a login time-out that was too large. The maximum login time out was used instead. |
07006 | Conversions not allowed using bcp_moretext. | The application using bcp_moretext must have the same field type as it does the column type. |
08004 | Server rejected the connection; Access to selected database has been denied. | Either the database does not exist or the user does not have permission to access the database. |
08004 | Server rejected the connection; Language specified is not supported. | Either the language name is invalid or the language is not installed on SQL Server. |
HY024 | Database is invalid or cannot be accessed. | Either the database does not exist or the user does not have permission to access the database. |
IM006 | Packet size change not supported by server, default used. | The application requested a nondefault packet size that SQL Server does not support. The client default size was used. |
HY000 | All bound columns are read-only. | There must be an updatable column to use SQLSetPos or SQLBulkOperations to change or insert a row. |
HY000 | An old netlib (%s) has been detected. Please delete it and restart the application. | The netlib that was being loaded was out of date. The driver requires a newer netlib.
The problem could be a netlib in the current directory of the application, which is being loaded instead of the one in the system directory, or it could be that the netlib was not installed properly or is corrupted. If the netlib specified in the error text exists elsewhere than in the Windows system directory, delete it. If the netlib exists only in the system directory, install the client utilities on the client and restart the application. |
HY000 | Attempt to bulk-copy a NULL value into a Server column which does not accept NULL values. | The field contains a NULL value, but the column does not allow NULL values. |
HY000 | Attempt to bulk-copy an oversized column to the SQL Server. | The length supplied for a column is larger than the column definition in the table. |
HY000 | Attempt to read unknown version of BCP format file. | The header line in the bcp format file was not a recognized version. |
HY000 | Bad bulk-copy direction. Must be either IN or OUT. | The bcp_init call did not specify a valid direction for the eDirection parameter. |
HY000 | Bad terminator. | The terminator string supplied in bcp_bind is invalid. |
HY000 | Bcp host-files must contain at least one column. | No columns were selected to be loaded. |
HY000 | Cannot generate SSPI context. | The driver could not obtain an SSPI context required for integrated security. The native error will contain the Win32 error code. |
HY000 | Cannot initialize SSPI package. | The driver could not obtain an SSPI context required for integrated security. The native error will contain the Win32 error code. |
HY000 | Communication module is not valid. Driver has not been correctly installed. | The network library .dll is corrupted. Install the client utilities on the client and restart the application. |
HY000 | Connection is busy with results for another hstmt. | The SQL Server ODBC driver allows only one active hstmt. For more information, see Using Default Result Sets. |
HY000 | Connection is not enabled for BCP. | The application using the BCP API must set the SQLSetConnectAttr or SQL_SS_COPT_BCP attribute before connecting. |
HY000 | Failure during closing of connection. | The ConnectionClose function in the network library failed. This problem is typically caused by a network or SQL Server problem. |
HY000 | For BCP, all variable-length data must have either a length-prefix or a terminator specified. | bcp_bind was called with SQL_VARYLEN_DATA, but neither a prefix length nor a terminator was specified. |
HY000 | Host-file columns may be skipped only when copying into the server. | A bcp out format file specified that a column should be skipped. This is not allowed. Either create a view containing only the desired columns and bcp out from that view, or use the -Q flag to provide a SELECT statement selecting only the desired columns. |
HY000 | Incorrect host-column number found in BCP format-file. | The format file contains a column number greater than the number of columns in the table. |
HY000 | I/O error while reading bcp data-file. | |
HY000 | I/O error while reading BCP format file. | |
HY000 | I/O error while writing bcp data-file. | |
HY000 | I/O error while writing bcp error-file. | |
HY000 | Invalid option. | The eOption parameter to bcp_control was not valid. |
HY000 | Non-default parameter not allowed after default parameter. | Parameters to a stored procedure cannot have a non-default value after any preceding parameter has been specified with the default value. |
HY000 | Not enough columns bound. | For a bcp out, not all columns of the table were bound. Either create a view which contains only the desired columns and bcp out from that view or, use the -Q flag to provide a SELECT statement selecting only the desired columns. |
HY000 | ODBC BCP/Driver version mismatch. | The Sqlsrv32.dll and Odbcbcp.dll .dlls do not have identical versions. Install the client utilities on the client and restart the application. |
HY000 | Protocol error in TDS stream. | The TDS stream from the server is invalid. This problem is typically caused by a SQL Server problem. Check the SQL Server error log. |
HY000 | Table contains less rows than first row count. | A starting row number was supplied, but the table on the server did not contain that number of rows. No rows were copied to the host-file. |
HY000 | Table contains less rows than last row count. | An ending row number was supplied, but the table on the server did not contain that number of rows. |
HY000 | Table has no text/image columns. | bcp_moretext was called, but the table does not contain any text or image columns. |
HY000 | TDS buffer length too large. | The TDS stream from the server is invalid. This problem is typically caused by a SQL Server problem. Check the SQL Server error log. |
HY000 | Text column data incomplete. | The summation of the lengths supplied by bcp_moretext did not match the length supplied in bcp_bind or bcp_collen. |
HY000 | The BCP host-file contains less rows than first row count. | A starting row number was supplied, but the host-file did not contain that number of rows. No rows were loaded. |
HY000 | The row length exceeds SQL Server’s maximum allowable size. | The summation of the data lengths for a row is larger than the maximum row size. |
HY000 | The stored procedure required to complete this operation could not be found on the server (they were supplied with SQL Server). Please contact your system administrator. | Install the ODBC catalog stored procedures by executing MsqqlInstallInstcat.sql. |
HY000 | Unable to load communication module. Driver has not been correctly installed. | The network library .dll specified for the connection does not exist on this client. Install the client utilities on the client and restart the application. |
HY000 | Unable to open BCP host data-file. | The file name specified in the bcp_init call does not exist or is opened by another application. |
HY000 | Unable to open BCP error-file. | The error file name specified in the bcp_init call does not exist or is opened by another application. |
HY000 | Unable to read driver version. | The driver was unable to read the version block in its .DLL. Install the client utilities on the client and restart the application. |
HY000 | Unexpected EOF encountered in BCP data-file. | During a bcp in operation, end-of-file was detected on the data file while in the middle of processing the last row. This is typically caused by having a different number of columns, types, nullability, or sizes between the original table and the table being loaded. |
HY000 | Unicode conversion failed. | An error occurred during conversion to or from a Unicode string. The native error will contain the Win32 error code. |
HY000 | Unicode conversion failed. The code page of the SQL server must be installed on the client system. | The server code page must exist on the client for proper operation. Either clear the Auto Translate check box for the DSN or install the code page of the server on the client. The server code page can be determined by running EXEC sp_server_info 18. |
HY000 | Unknown token received from SQL Server. | The TDS stream from the server is invalid. This error is typically caused by a problem on the server. Check the SQL Server error log. |
HY000 | Warning: Partial insert/update. The insert/update of a text or image column(s) did not succeed. | A failure during insertion or update of a text, image, or ntext column occurred. That column will not contain the proper data. Roll back the transaction, if possible. |