CollatingOrder Property

Applies To

Database object, Field object.

Description

Returns a value that specifies the sequence of the sort order in text for string comparison or sorting (Microsoft Jet workspaces only).

Return Values

The return value is a Long value or constant that can be one of the following values.

Constant

Sort order

dbSortGeneral

General (English, French, German, Portuguese, Italian, and Modern Spanish)

dbSortArabic

Arabic

dbSortChineseSimplified

Simplified Chinese

dbSortChineseTraditional

Traditional Chinese

dbSortCyrillic

Russian

dbSortCzech

Czech

dbSortDutch

Dutch

dbSortGreek

Greek

dbSortHebrew

Hebrew

dbSortHungarian

Hungarian

dbSortIcelandic

Icelandic

dbSortJapanese

Japanese

dbSortKorean

Korean

dbSortNeutral

Neutral

dbSortNorwDan

Norwegian or Danish

dbSortPDXIntl

Paradox International

dbSortPDXNor

Paradox Norwegian or Danish


(continued)

dbSortPDXSwe

Paradox Swedish or Finnish

dbSortPolish

Polish

dbSortSlovenian

Slovenian

dbSortSpanish

Spanish

dbSortSwedFin

Swedish or Finnish

dbSortThai

Thai

dbSortTurkish

Turkish

dbSortUndefined

Undefined or unknown


Remarks

The availability of the CollatingOrder property depends on the object that contains the Fields collection, as shown in the following table.

If the Fields collection belongs to an

Then CollatingOrder is

Index object

Not supported

QueryDef object

Read-only

Recordset object

Read-only

Relation object

Not supported

TableDef object

Read-only


The CollatingOrder property setting corresponds to the locale argument of the CreateDatabase method when the database was created or the CompactDatabase method when the database was most recently compacted.

Check the CollatingOrder property setting of a Database or Field object to determine the string comparison method for the database or field. You can set the CollatingOrder property of a new, unappended Field object if you want the setting of the Field object to differ from that of the Database object that contains it.

The CollatingOrder and Attributes property settings of a Field object in a Fields collection of an Index object together determine the sequence and direction of the sort order in an index. However, you can't set a collating order for an individual index — you can only set it for an entire table.

See Also

Attributes property.

Example

This example displays the CollatingOrder property for the Northwind database and for individual fields in a table.

Sub CollatingOrderX()

    Dim dbsNorthwind As Database
    Dim fldLoop As Field

    Set dbsNorthwind = OpenDatabase("Northwind.mdb")
    With dbsNorthwind
        ' Show collating order of Northwind database.
        Debug.Print "Collating order of " & .Name & " = " & _
            .CollatingOrder

        ' Show collating order of a TableDef object's fields.
        Debug.Print "Collating order of fields in " & _
            .TableDefs(0).Name & " table:"
        For Each fldLoop In .TableDefs(0).Fields
            Debug.Print "    " & fldLoop.Name & " = " & _
                fldLoop.CollatingOrder
        Next fldLoop

        .Close
    End With

End Sub
Example (Microsoft Access)

The following example checks the CollatingOrder property for the current database:

Sub SetSortOrder()
    Dim dbs As Database

    ' Return reference to current database.
    Set dbs = CurrentDb
    ' Check CollatingOrder property for database.
    Debug.Print dbs.CollatingOrder
    Set dbs = Nothing
End Sub