The information in this article applies to:
SYMPTOMS
When using Microsoft ActiveX Data Objects (ADO) with the Microsoft Access
ODBC driver, attempts to programmatically check the nullability of a field
with the ADO Field "Attributes" property, returns True even if the field is
a required (non-nullable) field. CAUSE
ADO calls the ODBC API function SQLColAttributes(), with the
SQL_COLUMN_NULLABLE flag, to determine if a field is nullable with the
Microsoft Access ODBC driver. The Microsoft Access ODBC driver does not
properly report the nullability of a column using this API function. The
Microsoft Access ODBC driver reports that every field is nullable when
using the SQLColAttributes() ODBC API function. RESOLUTIONThe Microsoft Access ODBC driver does not provide a programmatic means of determining the nullability property of a column in a table. You can attempt to add a record and trap for the following error number returned by ADO: This error returns the following error description: You can also use Microsoft Data Access Objects (DAO) to open a table and this properly returns the nullability of a field using the "Required" property of the Field object. This functionality is available with the Microsoft Jet OLEDB Provider 4.0 and later that comes with Microsoft Data Access Objects 2.1 and later. You may obtain Microsoft Data Access Objects 2.1 and later from the following site: http://www.microsoft.com/data/download.htm STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. MORE INFORMATIONThe following VBA code sample demonstrates the issue:
Additional query words: Keywords : kbAccess kbADO kbADO200bug kbDatabase kbDriver kbJET kbODBC kbOLEDB kbProvider kbODBC350bug kbGrpVBDB kbGrpMDAC kbDSupport kbADO210sp2Version : WINDOWS:1.0,1.5,2.0,3.5,3.51,4.0 Platform : WINDOWS Issue type : kbbug |
Last Reviewed: October 21, 1999 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |