ACC2: Setting a Database's V1xNullBehavior Property

Last reviewed: June 8, 1997
Article ID: Q114548
The information in this article applies to:
  • Microsoft Access version 2.0

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

REFERENCES

For more information about the V1xNullBehavior property, search for "V1xNullBehavior" then "V1xNullBehavior Property" using the Microsoft Access Help menu.

Microsoft Access "Building Applications," Appendix C, "Conversion Issues and New Features for Access Basic"

Microsoft Access "Building Applications," Chapter 7


Keywords : kbprg PgmOthr
Version : 2.0
Platform : WINDOWS
Hardware : X86
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 8, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.