Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

INDBC()

This function tells you whether a specified object is in the current database.

Usage

lItsInThere = INDBC( cObjectName, cObjectType )

Parameter

Value

Meaning

cObjectName

Character

The name of the item to look for in the database.

cObjectType

"Table"

Check for a table called cObjectName in the database.

"Field"

Check for a field called cObjectName in the database. cObjectName must contain the alias and field name.

"Index"

Check for an index called cObjectName in the database. cObjectName must contain the alias and the tag name.

"View"

Check for a view called cObjectName in the database.

"Connection"

Check for a connection called cObjectName in the database.

INDBC() works only for the current database and only if you know the name of the object you’re interested in. To find out what tables, views and connections are in the database, use ADBOBJECTS(). For fields, use AFIELDS(). For indexes, use the ATAGINFO() function.

Example

OPEN DATA TasTrade
? INDBC("Customer","Table")              && Returns .T.
? INDBC("Fred","Table")                  && Returns .F.
? INDBC("Customer.Company_name","Field") && Returns .T.
? INDBC("Supplier Listing","View") && Returns .T.
? INDBC("Furshlugginer","Connection")    && Returns .F.
? INDBC("Customer.Company_Na","Index")   && Returns .T.
? INDBC("Company_Na","Index")            && Returns .F.

See Also

ADBObjects(), AFields(), ATagInfo(), Candidate(), DBC(), DBGetProp()