Microsoft KB Archive/279245

= FIX: Default Column Properties Cleared When You Set or Check Values by Using ADOX to an Access Database =

Article ID: 279245

Article Last Modified on 11/25/2003

-

APPLIES TO


 * Microsoft Data Access Components 2.5 Service Pack 1
 * Microsoft Data Access Components 2.5
 * Microsoft OLE DB Provider for Jet 4.0

-



This article was previously published under Q279245



SYMPTOMS
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.



RESOLUTION
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:

239114 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.



STATUS
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.



MORE INFORMATION
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 &quot;The MDAC 2.5 Stack and Windows File Protection&quot; 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:

http://www.microsoft.com/data/mdacwfp.htm

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.</li>  Add the following code to Form1: Option Explicit

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 = &quot;C:\TestDB.mdb&quot;        'Path for database strConn = &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; & strDBPath & &quot;;&quot; 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 = &quot;TestTable&quot;        '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 = &quot;TestColumn&quot;           '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(&quot;TestTable&quot;) 'Reference new table object DBTable.Columns(&quot;TestColumn&quot;).Properties(&quot;Default&quot;).Value = 5 'Set value for property Exit Sub ErrHandler: MsgBox &quot;Error: &quot; & Err.Number & &quot; &quot; & Err.Description End Sub </li> Set strDBPath to a database name to be created.</li></ol>

Keywords: kbbug kbfix kbmdacnosweep KB279245

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.