Condividi tramite


Alias Property

Specifies an alias name for the appropriate object. Read/write at design time and run time.

The Alias property mimics the behavior of the ALIAS clause in the USE command. There are several versions of this syntax.

DataEnvironment.Cursor.Alias [= cText]

CursorAdapter.Alias [= cText]

XMLTable.Alias [= cText]

XMLTable.XMLField.Alias [= cText]

Return Value

  • cText
    Character data type. The following table describes the values for cText, depending on the object.

    Object

    cText

    Cursor

    Alias name for each table or view associated with the cursor.

    CursorAdapter

    Alias name for the cursor generated by the SelectCmd property.

    XMLTable

    Alias name for the Visual FoxPro cursor.

    If cText is an empty string (""), the XMLAdapter ToXML method adds the table schema but does not add any data.

    XMLField

    Alias name for the field name in the Visual FoxPro cursor.

    If cText is an empty string (""), the XMLTable ToCursor and ApplyDiffGram methods disregard the field.

Remarks

Applies To: Cursor Object | CursorAdapter Class | XMLTable Class | XMLField Class

For Cursor objects, when Visual FoxPro loads the data environment, it assigns an alias name that is the same as the table or view name to each table or view associated with the cursor by default. You can change the Alias property to override the default alias name.

For CursorAdapter objects, Visual FoxPro uses Alias property to resolve the correct alias name for tables and fields that you drag and drop to the form from the data environment at design time. If you do not specify values for Alias, Visual FoxPro generates an error and, at run time, uses the default aliases for the tables and fields.

For XMLTable and XMLField objects, Visual FoxPro loads the value of the XMLName property into the corresponding Alias property for those objects by default. If the XMLField Alias property is empty, the XMLTable ToCursor method disregards XMLField objects and creates a cursor that does not include any fields specified by those XMLField objects.

If you change the Alias property, Visual FoxPro also renames the cursor created by the ToCursor method and the Alias properties for XMLTable and XMLField objects.

When executing the ToXML method, Visual FoxPro uses the XMLName property instead of the Alias  property.

See Also

Reference

USE Command

ALIAS( ) Function

InitialSelectedAlias Property

ParentAlias Property

Other Resources

Properties (Visual FoxPro)

Language Reference (Visual FoxPro)