LabWindows/CVI SQL Toolkit Error Codes

LabWindows/CVI SQL Toolkit 2.3 Help

Edition Date: August 2015

Part Number: 370502D-01

»View Product Info
Download Help (Windows Only)

This topic describes the error codes returned by functions in the LabWindows/CVI SQL Toolkit. In many cases, you can obtain additional information about errors by using DBErrorMessage. The last section in this topic explains error messages that might be vague or misleading.

SQL Toolkit Error Codes

The following table lists error codes that the LabWindows/CVI SQL Toolkit can return.

Error Code Error Constant Name Description/Cause
0 DB_SUCCESS No errors detected.
-1 DB_TRUNCATION The buffer passed in to hold a result is not large enough to hold the result. A partial result has been returned in the buffer.
-2 DB_NULL_DATA The field/column contains null. Returned as the length from a qeDataLen call.
-3 DB_OUT_OF_MEMORY Insufficient memory for operation.
-5 DB_EOF No more records to read.
-9 DB_NO_DATA_CHANGE Do not update this column/field. Set the status variable of a bound variable to this value to prevent the column/field from being updated by DBPutRecord.
-10 DB_DBSYS_ERROR Error detected by the underlying database system or driver.
-11 DB_AUTOMATION_ERROR Error detected by OLE Automation.
-12 DB_ODBC_ERROR ODBC error detected in DBSources. Call DBNativeError to get the underlying error code.
-59 DB_TRUNCATION_RETRY_FAILED Errors occurred. Possible cause: value too large for field/column and ADO provider does not support retry with truncated data.
-60 DB_ILLEGAL_MULTIPLE_MAP_ACTIVATIONS Map is already active, cannot activate again.
-61 DB_SINGLE_THREAD_INIT_FAILED Cannot initialize for single threaded, the toolkit has already been initialized for multiple threads.
-62 DB_ALREADY_BOUND The specified column is already bound to a variable.
-63 DB_NEGATIVE_SIZE Negative size not permitted.
-64 DB_UNSUPPORTED_SOURCE_TYPE DB_SRC_AVAILABLE is the only value allowed for Source Type.
-65 DB_WRITES_PENDING There are open writes pending. Call DBPutRecord before calling DBDeactivateMap, DBDeactivateSQL, or DBDiscardSQLStatement.
-66 DB_NOT_ENOUGH_RECORDS Start record plus number of records to get is greater than number of available records.
-67 DB_FIELD_NUMBER_TOO_BIG Field number requested is larger then the number of fields.
-68 DB_START_REC_TOO_BIG Start record number is larger than the number of records.
-69 DB_FORMAT_IGNORE_NO_DATA_FORMAT Format ignored because it contains no format for data.
-70 DB_FORMAT_IGNORE_INCOMPAT Format ignored because the format is invalid for the value.
-71 DB_FORMAT_ERROR Error in format.
-72 DB_INVALID_CONN_ATTRIBUTE Invalid connection attribute.
-73 DB_CONN_ATTR_READ_ONLY The specified attribute is read only for a connection.
-74 DB_REQUIRES_COMMAND This attribute is only valid when a command object exists.
-75 DB_REQUIRES_RECORDSET This attribute is only valid when a recordset exists.
-76 DB_INVALID_FOR_RECORDSET Invalid attribute for recordset based statement.
-77 DB_INVALID_FOR_COMMAND Invalid attribute for command based statement.
-78 DB_INVALID_STMT_ATTRIBUTE Invalid statement attribute.
-79 DB_STMT_ATTR_READ_ONLY The specified attribute is read only for statments.
-80 DB_COLUMN_ATTR_READ_ONLY The specified attribute is read only for columns/fields.
-81 DB_INVALID_COLUMN_ATTRIBUTE Invalid column attribute.
-83 DB_INVALID_PARAMETER_ATTRIBUTE Invalid parameter attribute.
-84 DB_CANT_GET_NATIVE_ERROR Native error not supported by ADO.
-85 DB_UNSUPPORTED_TYPE Data type requested is not supported for this function.
-86 DB_INVALID_COLUMN_NUMBER Invalid field/column number.
-87 DB_INVALID_ATTRIBUTE Invalid attribute.
-88 DB_UNEXPECTED_NULL_PTR Unexpected NULL pointer.
-89 DB_CANT_FIND_MAP Invalid map handle.
-90 DB_UNKNOWN_TABLES_FLAG Unknown flag value for DBTables.
-91 DB_SYNONYM_NOT_SUPPORTED DB_TBL_SYNONYM not supported.
-92 DB_CANT_DETERMINE_NUM_RECS Cannot determine the number of records in the recordset.
-93 DB_CANT_FIND_CONNECTION Invalid connection handle.
-94 DB_CANT_FIND_STMT Invalid statement or connection handle.
-96 DB_BETA_EXPIRED Beta version of SQL Toolkit expired.
-97 DB_CONNECTION_NOT_SAVED Could not save connection info. (Probably out of memory.)
-98 DB_STMT_NOT_SAVED Could not save statement info. (Probably out of memory.)
-99 DB_SMALLER_THAN_COLUMN_WIDTH Warning: target character buffer is smaller than the column width
-294 DB_CS_ALREADY_INIT Thread safe error: Critical section already initialized.
-295 DB_CS_NOT_OWNED Thread safe error: Critical section not owned.
-296 DB_CS_NOT_INIT_OR_DELETED Thread safe error: Critical section has not been initialized or has been deleted.
-297 DB_CS_SYSTEM_ERROR Thread safe error: System error.
-298 DB_CS_INVALID_PARAMETER Thread safe error: Invalid parameter.
-299 DB_CS_OUT_OF_MEMORY Thread safe error: Out of memory.

Error Codes for LabWindows/CVI ActiveX Library

For more information about error codes returned by the LabWindows/CVI ActiveX Library, refer to the ActiveX Library Error Conditions topic in the LabWindows/CVI Help.

Error Messages That Might Be Vague or Misleading

If you misspell a field/column name in a call to a DBMapColumnTo function, some database systems, including Microsoft Access, interpret the misspelled name as a parameter. When you call a DBFetch function, Access returns the following error:

Too few parameters. Expected 1

If you execute a SELECT statement with DBImmediateSQL, you cannot access the selected records, and some database systems do not release the locks for tables in the SELECT statement.

The vague error code Errors Occurred might appear, for example, when you bind, map, or put an integer or floating point value into a string field/column that is too small to contain the value.

Undefined Error does not occur because of one specific cause. This error can occur if you request the value of a connection attribute from a statement instead of a connection. This error also can occur if you attempt to write records to a Microsoft SQL Server table that contains only double or float columns. Because of the problems with exact comparison of floating-point values, SQL Server does not consider floating-point columns when it constructs its internal WHERE clause to uniquely identify a record. Thus, in a table that contains only floating point columns, SQL Server has no way to uniquely identify records.

WAS THIS ARTICLE HELPFUL?

Not Helpful