次の方法で共有


CURSORGETPROP( ) Function

Returns the current property settings for a Visual FoxPro table or a cursor.

CURSORGETPROP(cProperty [, nWorkArea | cTableAlias])

Return Values

Character, Numeric, or Logical

Parameters

  • cProperty
    Specifies the property setting to return.

    The following table includes a list of properties whose settings can be returned, the data type of the return value, and a description of the return value.

    cProperty Type Description
    BatchUpdateCount* N The number of update statements sent to the remote data source for buffered tables. 1 is the default. Adjusting this value can greatly increase update performance.

    Read-Write.

    Buffering N 1 – (Default) Row and table buffering is off.

    2 – Pessimistic row buffering is on.

    3 – Optimistic row buffering is on.

    4 – Pessimistic table buffering is on.

    5 – Optimistic table buffering is on.

    Read-Write.

    CompareMemo L Contains true (.T.) (default) if memo fields (of type Memo, General, or Picture) are included in the WHERE clause for updates; otherwise, contains false (.F.). For views only.

    Read-Write.

    ConnectHandle N The connection handle. This property is valid only when the data source contains a remote table.

    Read-Only.

    ConnectName C The named connection used when the cursor is created. This property is valid only when the data source contains a remote table.

    Read-Only.

    Database C The name of the database in which the table or view is contained. If a table is a free table, contains the empty string.

    Read-Only.

    FetchAsNeeded L Contains true (.T.) if data is fetched as needed; otherwise, contains false (.F.) (default). For views only.

    Read-Write.

    FetchMemo* L Contains true (.T.) if memo fields are fetched with the view results; otherwise, contains false (.F.) (default).

    Read-Write.

    FetchSize* N The number of rows progressively fetched from the table result set. 100 rows is the default. Setting FetchSize to -1 retrieves the complete result set (limited by the MaxRecords setting).

    Read-Write.

    KeyFieldList C Comma delimited list of primary fields for the cursor.

    Read-Write.

    MaxRecords* N The maximum number of rows fetched when result sets are returned. The default is – 1 (all rows are returned). A value of 0 specifies that the view is executed but no results are fetched.

    Read-Write.

    Prepared L Contains true (.T.) if SQL statements are prepared for subsequent REQUERY( ) function calls; otherwise, contains false (.F.) (default). REQUERY( ) is used to retrieve data again for a SQL view. See SQLPREPARE( ) for additional information about preparing SQL statements. For views only.

    Read-Write.

    SendUpdates L Contains true (.T.) if a SQL update query is sent to update tables when an update is made using the view; otherwise, contains false (.F.) (default).

    Read-Write.

    SourceName C Contains the long name for a SQL view or a table in a database, or the file path and table name for a free table.

    Read-Only.

    SourceType N 1 – Specifies that the data source is a local SQL view.

    2 – Specifies that the data source is a remote SQL view.

    3 – Specifies that the data source is a table.

    Read-Only.

    SQL C The SQL statement executed when the cursor is created.

    Read-Only.

    Tables C A comma delimited list of the names of tables.

    Read-Write.

    UpdatableFieldList C Comma delimited list of fields in the view. This list can include fields from local and remote tables.

    Read-Write.

    UpdateNameList C Comma delimited list of field names and the local field names assigned to the cursor. Use this option to specify valid Visual FoxPro names for fields in the cursor that have invalid Visual FoxPro field names.

    Read-Write.s

    UpdateType N 1 – Specifies that old data is updated with the new data (the default).

    2 – Specifies that updates occur by deleting the old data and inserting the new data.

    Read-Write.

    UseMemoSize* N The minimum size (in bytes) for which result columns are returned in memo fields. For example, if the width of a column result is greater than the value of UseMemoSize, the column result is stored in a memo field. UseMemoSize may vary from 1 to 255; the default value is 255.

    Read-Write.

    WhereType N The WHERE clause for updates to tables. WhereType may assume the following values:

    1 or DB_KEY (from FOXPRO.H). The WHERE clause used to update tables consists of only the primary fields specified with the KeyFieldList property.

    2 or DB_KEYANDUPDATABLE (from FOXPRO.H). The WHERE clause used to update tables consists of the primary fields specified with the KeyFieldList property and any updatable fields.

    3 or DB_KEYANDMODIFIED (from FOXPRO.H) (default). The WHERE clause used to update tables consists of the primary fields specified with the KeyFieldList property and any other fields that are modified.

    4 or DB_KEYANDTIMESTAMP (from FOXPRO.H). The WHERE clause used to update tables consists of the primary fields specified with the KeyFieldList property and a comparison of the time stamps.

    Read-Write.

    * The value returned by this property is significant only for remote views; if you get this property for local views, the CURSORGETPROP function returns the default value.

    The following table includes a list of properties whose settings can be returned, the data type of the return value, and a description of the return value.

  • nWorkArea
    Specifies the work area of the table or cursor from which the property setting is returned. If you specify 0 for nWorkArea, CURSORGETPROP( ) returns the environment setting.

  • cTableAlias
    Specifies the alias of the table or cursor from which the property setting is returned.

Remarks

Use CURSORSETPROP( ) to set a specific property for a Visual FoxPro table or a cursor. See CURSORSETPROP( ) for additional information about each of the properties and their settings.

The current property settings are returned for the table or cursor open in the currently selected work area if CURSORGETPROP( ) is issued without the optional cTableAlias or nWorkArea arguments.

Example

The following example opens the customer table in the testdata database. CURSORGETPROP( ) is then used to display the buffering mode for the table and the name of the database in which the table is contained.

CLOSE DATABASES
CLEAR

OPEN DATABASE (HOME(2) + 'data\testdata')
USE customer     && Open customer table

? CURSORGETPROP("Buffering") && Displays buffering mode
? CURSORGETPROP("Database")  && Displays database name

See Also

CURSORSETPROP( ) | SQLGETPROP( ) | SQLSETPROP( )