Microsoft KB Archive/114548

= ACC2: Setting a Database's V1xNullBehavior Property =

Article ID: 114548

Article Last Modified on 11/6/2000

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q114548



SUMMARY
In Microsoft Access version 2.0, the behavior of Null and zero-length strings differs from that in Microsoft Access version 1.x. Microsoft Access version 2.0 can distinguish between Null and zero-length strings, whereas Microsoft Access version 1.x cannot.

Because of this, Microsoft Access version 2.0 has a new property called V1xNullBehavior that you can use to cause Microsoft Access to convert zero- length strings to Null. This property applies only to version 1.x databases that have been converted to version 2.0. When you convert a database from version 1.x to version 2.0, the V1xNullBehavior property is automatically created.



MORE INFORMATION
The V1xNullBehavior property triggers these behaviors:


 * Assignments in Access Basic to DAO field objects is implicitly converted from zero-length strings to Null if the field does not support zero-length strings.
 * The SetValue action has similar mappings.

It is important to set the V1xNullBehavior property to the setting you want. Do not set the property if you do not fully understand the ramifications of setting it.

You can set the V1xNullBehavior property on an existing database using the following code in the database that you want to change:

Sub SetV1XNullBehavior Dim db As Database, prop As Property Set db = DBEngine.Workspaces(0).Databases(0) Set prop = db.CreateProperty("V1xNullBehavior", DB_INTEGER) prop.Value = True db.properties.Append prop db.Close End Sub

