Links are not active on this page.
 INDBC( ) Function

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.

Expand imageReturn Value

Logical

Expand imageRemarks

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

Expand imageExample

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.

 CopyCode imageCopy 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

Expand imageSee Also