V1xNullBehavior Property Example

This example converts a Microsoft Jet version 1.1 database file to a Microsoft Jet version 3.0 database file. During conversion, the V1xNullBehavior property is created and added to the Properties collection of the new database. The Properties collections of both database files are enumerated to show the change. Finally, the V1xNullBehavior property is deleted. This assumes that any applications will be modified to store Null values in empty Text and Memo fields rather than empty strings.

Note   Unless you can obtain a Microsoft Jet version 1.1 file called "Nwind11.mdb," this procedure will not run.

Sub V1xNullBehaviorX()

    Dim dbsNorthwind As Database
    Dim prpLoop As Property

    Set dbsNorthwind = OpenDatabase("Nwind11.mdb")

    With dbsNorthwind
        Debug.Print .Name & ", version " & .Version
        ' Enumerate Properties collection of Northwind 
        ' database.
        For Each prpLoop In .Properties
            On Error Resume Next
            If prpLoop <> "" Then Debug.Print "  " & _
                prpLoop.Name & " = " & prpLoop
            On Error GoTo 0
        Next prpLoop

        .Close
    End With

    DBEngine.CompactDatabase "Nwind11.mdb", _
        "Nwind30.mdb", , dbVersion30

    Set dbsNorthwind = OpenDatabase("Nwind30.mdb")

    With dbsNorthwind
        Debug.Print .Name & ", version " & .Version

        ' Enumerate Properties collection of compacted 
        ' database. The V1xNullBehavior property cannot be 
        ' referred to explicitly, that is, 
        ' dbsNorthwind.V1xNullBehavior, but it can be accessed 
        ' in loops or by string reference, that is,
        ' dbsNorthwind.Properties("V1xNullBehavior").
        For Each prpLoop In .Properties
            On Error Resume Next
            If prpLoop <> "" Then Debug.Print "  " & _
                prpLoop.Name & " = " & prpLoop
            On Error GoTo 0
        Next prpLoop

        .Properties.Delete "V1xNullBehavior"
        .Close
    End With

End Sub