JavaScript Editor js editor     Web development 



Main Page

Returns true (.T.) if the specified database object is in the current database; otherwise returns false (.F.).

INDBC(cDatabaseObjectName, cType)

Parameters

cDatabaseObjectName


Specifies the name of a named connection, field, index, table, or SQL view for which INDBC(В ) returns a logical value indicating whether or not the object is in the current database.
cType


Specifies the database object type of cDatabaseObjectName. The following table lists the values for cType and the corresponding database object type.

cType Database object type

CONNECTION

Named connection

FIELD

Field

INDEX

Index

TABLE

Table

VIEW

SQL View

The CONNECTION, FIELD, INDEX, TABLE, and VIEW settings cannot be abbreviated.

Return Value

Logical

Remarks

A database must be open and current when INDBC(В ) is issued; otherwise Visual FoxPro generates an error message.

Example

In the following example, a temporary database named mydbc is created, and a temporary table named mytable is added to the database. INDBC(В ) is used to determine if the new table is in the database. The database and table are closed and erased.

В Copy Code
CLOSE DATABASES
CREATE DATABASE mydbc  && Creates a new database
CREATE TABLE mytable (field1 C(10)) && Automatically added to database

? 'MyTable in the database? '
?? INDBC('mytable', 'TABLE')  && Returns .T.

CLOSE DATABASES
DELETE DATABASE mydbc DELETETABLES

See Also



JavaScript Editor js editor     Web development