When you set or check the default column values for any column in a table that is contained in an Access 2000 database, the default values for the column are cleared.
To resolve the problem, install the latest service pack for Microsoft Jet 4.0. Prior to installing the latest Jet 4.0 service pack, Microsoft recommends that you look at the following Microsoft Knowledge Base article for information and issues for downloading:
How To: Obtain the Latest Service Pack for the Microsoft Jet 4.0 Database Engine
For your reference, this article is updated periodically to provide you with the most up-to-date information regarding future Jet service packs.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
This problem can be fixed by installing the latest Jet 4.0 service pack.
Note that there are some issues that you need to be aware of when applying the Jet service pack onto a Windows 2000-based computer. The following white paper titled "The MDAC 2.5 Stack and Windows File Protection" contains a full list of the components that are shipped with MDAC 2.5, along with a discussion of Windows File Protection.
Also refer to this white paper for more information on the Jet dynamic-link libraries (DLLs) that are shipped in MDAC 2.5 and that are no longer a part of MDAC 2.6.
Steps to Reproduce Behavior
- Run Microsoft Visual Basic, and create a Standard EXE project. Form1 is created by default.
- On the Project menu, click References, and then add references to the following:
- Microsoft ActiveX Data Objects 2.6 Library
- Microsoft ADO Ext. 2.6 for DDL and Security
- Add a Command button to Form1.
- Add the following code to Form1:
Private Sub Command1_Click()
On Error GoTo ErrHandler 'Intercept any errors
Dim strConn As String 'Work
Dim strDBPath As String 'Path for new database
Dim DBCatalog As ADOX.Catalog 'ADOX catalog reference
Dim DBTable As ADOX.Table 'Database table definition
Dim DBColumn As ADOX.Column 'Column object within a table
strDBPath = "C:\TestDB.mdb" 'Path for database
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"
Set DBCatalog = New ADOX.Catalog 'Database root schema object
DBCatalog.Create strConn 'Create new database
Set DBTable = New ADOX.Table 'Create a new table object
DBTable.Name = "TestTable" 'Set name of table
Set DBTable.ParentCatalog = DBCatalog 'Make Properties collections available
'---Create a column in the table...
Set DBColumn = New ADOX.Column 'Column object to define
With DBColumn 'Reference new column
.Name = "TestColumn" 'Name the column
.Type = adInteger 'Type of data
.DefinedSize = 0 'Normal size of data
.Attributes = adColFixed 'Column attribute flags
.NumericScale = 0 'Numeric scaling factor
.Precision = 10 'Digits of Precision
End With 'Done with DBColumn reference
DBTable.Columns.Append DBColumn 'Add column to table
'---Add new table to the database...
DBCatalog.Tables.Append DBTable 'Add table to database
Set DBTable = DBCatalog.Tables("TestTable") 'Reference new table object
DBTable.Columns("TestColumn").Properties("Default").Value = 5 'Set value for property
MsgBox "Error: " & Err.Number & " " & Err.Description
- Set strDBPath to a database name to be created.
Article ID: 279245 - Last Review: February 28, 2014 - Revision: 3.3
- Microsoft Data Access Components 2.5 Service Pack 1
- Microsoft Data Access Components 2.5
- Microsoft OLE DB Provider for Jet 4.0
|kbnosurvey kbarchive kbbug kbfix kbmdacnosweep KB279245|